summaryrefslogtreecommitdiffstats
path: root/lld/test/mach-o/Inputs
Commit message (Collapse)AuthorAgeFilesLines
* Replace -flavor {gnu,darwin} with ld64.lld or ld.lld.Rui Ueyama2018-02-162-2/+2
| | | | llvm-svn: 325390
* Partially revert r287009: Remove trailing whitespace.Rui Ueyama2016-11-152-0/+0
| | | | | | This reverts part of r287009 because I accidentally changed binary files. llvm-svn: 287010
* Remove trailing whitespace.Rui Ueyama2016-11-152-0/+0
| | | | llvm-svn: 287009
* Change all the libSystem test files to be dylibs instead of normalized ↵Pete Cooper2016-08-114-20/+24
| | | | | | | | | | | | | files. Currently NFC. A future commit will change when we choose to add an LC_LOAD_DYLIB to the final image. Currently we do this when an atom is used, but we need to do it when a dylib is referenced on the cmdline as this matches ld64. To allow this change, libsystem (and other future yaml files representing dylibs) need to be dylibs so that the loader can see to add them to the referenced dylib list. llvm-svn: 278386
* Have one version of libSystem for each arch. NFC.Pete Cooper2016-08-114-1/+36
| | | | | | | | | | | | | | | An upcoming commit will change how we choose to reference a dylib. Currently dylibs are only given an LC_LOAD_DYLIB in the final image if an atom is used. This is different from ld64 which adds the load command when the dylib is referenced on the cmdline. In order to change this behaviour, we need libSystem.yaml to actually contain a mach header so that it is parsed as a dylib, instead of currently being parsed as a normalised file. To get a mach header, we also require an arch, so now we have one libsystem per arch and all the tests have been updated to choose the correct one. llvm-svn: 278372
* Generate version min load commands when the platform is unknown.Pete Cooper2016-02-041-0/+22
| | | | | | | | | | | In the case where we are emitting to an object file, the platform is possibly unknown, and the source object files contained load commands for version min, we can take the maximum of those min versions and emit in in the output object file. This test also tests r259739. llvm-svn: 259742
* Add checking of differing swift versions in input files.Pete Cooper2016-01-161-0/+18
| | | | | | | Swift versions are part of the objc image info section, and must match for all files linked which actually have an image info section llvm-svn: 257964
* [lld][Darwin] Add support for the -sectcreate option.Lang Hames2015-10-241-0/+1
| | | | llvm-svn: 251183
* Remove trailing whitespace characters.Rui Ueyama2015-04-272-16/+16
| | | | llvm-svn: 235897
* Delete unnecessary generality in loadFile.Rafael Espindola2015-04-2423-0/+484
| | | | | | | | | | | | | loadFile could load mulitple files just because yaml has a feature for putting multiple documents in one file. Designing a linker around what yaml can do seems like a bad idea to me. This patch changes it to read a single file. There are further improvements to be done to the api and they will follow shortly. llvm-svn: 235724
* Make libmyshared.dylib a fat binary.Rui Ueyama2015-01-151-0/+0
| | | | | | This would have caught the issue that I made in r225764. llvm-svn: 226072
* [py3] Make this test compatible with Python 3 where bytes andChandler Carruth2014-12-291-8/+8
| | | | | | | | strings don't mix so easily. This fixes the last remaining failure I have in 'check-all' on a system with both Python3 and and Python2 installed. llvm-svn: 224947
* [mach-o] Add support for -order_file optionNick Kledzik2014-11-071-0/+11
| | | | | | | | | | | The darwin linker lets you rearrange functions and data for better locality (less paging). You do this with the -order_file option which supplies a text file containing one symbol per line. Implementing this required a small change to LayoutPass to add a custom sorter hook. llvm-svn: 221545
* Subclass InputGraph to get darwin linker library semanticsNick Kledzik2014-10-211-0/+0
| | | | | | | | | | | | | | | | | | | The darwin linker operates differently than the gnu linker with respect to libraries. The darwin linker first links in all object files from the command line, then to resolve any remaining undefines, it repeatedly iterates over libraries on the command line until either all undefines are resolved or no undefines were resolved in the last pass. When Shankar made the InputGraph model, the plan for darwin was for the darwin driver to place all libraries in a group at the end of the InputGraph. Thus making the darwin model a subset of the gnu model. But it turns out that does not work because the driver cannot tell if a file is an object or library until it has been loaded, which happens later. This solution is to subclass InputGraph for darwin and just iterate the graph the way darwin linker needs. llvm-svn: 220330
* [mach-o] Add support for upward linkingNick Kledzik2014-10-161-0/+18
| | | | | | | | To deal with cycles in shared library dependencies, the darwin linker supports marking specific link dependencies as "upward". An upward link is when a lower level library links against a higher level library. llvm-svn: 219949
* [mach-o] Support fat archivesNick Kledzik2014-10-081-0/+0
| | | | | | | | | | | | | | mach-o supports "fat" files which are a header/table-of-contents followed by a concatenation of mach-o files (or archives of mach-o files) built for different architectures. Previously, the support for fat files was in the MachOReader, but that only supported fat .o files and dylibs (not archives). The fix is to put the fat handing into MachOFileNode. That way any input file kind (including archives) can be fat. MachOFileNode selects the sub-range of the fat file that matches the arch being linked and creates a MemoryBuffer for just that subrange. llvm-svn: 219268
* [mach-o] Add support for -dependency_info command line optionNick Kledzik2014-10-041-0/+30
| | | | | | | | | | | This option is added by Xcode when it runs the linker. It produces a binary file which contains the file the linker used. Xcode uses the info to dynamically update it dependency tracking. To check the content of the binary file, the test case uses a python script to dump the binary file as text which FileCheck can check. llvm-svn: 219039
* [mach-o] Add support for -exported_symbols_list and -keep_private_externsNick Kledzik2014-08-211-0/+6
| | | | | | | | | | | | | | Both options control the final scope of atoms. When -exported_symbols_list <file> is used, the file is parsed into one symbol per line in the file. Only those symbols will be exported (global) in the final linked image. The -keep_private_externs option is only used with -r mode. Normally, -r mode reduces private extern (scopeLinkageUnit) symbols to non-external. But add the -keep_private_externs option keeps them private external. llvm-svn: 216146
* [mach-o] Support -filelist option in darwin driverNick Kledzik2014-08-152-0/+6
| | | | | | | | | | | | The darwin linker has an option, heavily used by Xcode, in which, instead of listing all input files on the command line, the input file paths are written to a text file and the path of that text file is passed to the linker with the -filelist option (similar to @file). In order to make test cases for this, I generalized the -test_libresolution option to become -test_file_usage. llvm-svn: 215762
* [mach-o] Fix stub generation to work for dylibs and bundlesNick Kledzik2014-08-131-0/+13
| | | | | | | | | | Split up the CRuntimeFile into one part for output types that need an entry point and another part for output types that use stubs. Add file 'test/mach-o/Inputs/libSystem.yaml' for use by test cases that use -dylib and therefore may now need the helper symbol in libSystem.dylib. llvm-svn: 215602
* [mach-o]: support -syslibroot and -l optionsTim Northover2014-07-103-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | These behave slightly idiosyncratically in the best of cases, and have additional hacks layered on top of that for compatibility with badly behaved build systems (via ld64). For -lXYZ: + If XYZ is actually XY.o then search all library paths for XY.o + Otherwise search all library paths, first for libXYZ.dylib, then libXYZ.a + By default the library paths are /usr/lib and /usr/local/lib in that order. For -syslibroot: + -syslibroot options apply to absolute paths in the search order. + All -syslibroot prefixes that exist are added to the search path *instead* of the original. + If no -syslibroot prefixed path exists, the original is kept. + Hacks^WExceptions: + If only 1 -syslibroot is given and doesn't contain /usr/lib or /usr/local/lib, that path is dropped entirely. (rdar://problem/6438270). + If the last -syslibroot is "/", all of them are ignored entirely. (rdar://problem/5829579). At least, that's my best interpretation of what ld64 does in buildSearchPaths. llvm-svn: 212706
* [mach-o] add representation for LC_ID_DYLIB to MachONormalizedFileTim Northover2014-07-011-0/+28
It still needs to be tied into BinaryReader, but this allows reasonably sensible creation of SharedLibrary atoms on MachO. llvm-svn: 212093
OpenPOWER on IntegriCloud