llvm-project/lld/MachO
Nico Weber 17c43c4045 [lld/mac] Add reexports after reexporter to inputFiles
When a library "host"'s reexports change their installName with
`$ld$os10.11$install_name$host`, we used to write a load command for "host" but
write the version numbers of the reexport instead of "host". This fixes that.

I first thought that the rule is to take the version numbers from the library
that originally had that install name (implemented in D103819), but that's not
what ld64 seems to be doing: It takes the version number from the first dylib
with that install name it loads, and it loads the reexporting library before
the reexports. We already did most of that, we just added reexports before the
reexporter. After this change, we add the reexporter before the reexports.

Addresses https://bugs.llvm.org/show_bug.cgi?id=49800#c11 part 1.

(ld64 seems to add reexports after processing _all_ files on the command line,
while we add them right after the reexporter. For the common case of reexport +
$ld$ symbol changing back to the exporter name, this doesn't make a difference,
but you can construct a case where it does. I expect this to not make a
difference in practice though.)

Differential Revision: https://reviews.llvm.org/D103821
2021-06-07 17:04:03 -04:00
..
Arch [lld-macho] Implement branch-range-extension thunks 2021-05-12 09:44:58 -07:00
CMakeLists.txt [lld-macho] Fix BUILD_SHARED_LIBS build 2021-06-03 19:58:43 +01:00
ConcatOutputSection.cpp [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
ConcatOutputSection.h [lld-macho][nfc] Rename MergedOutputSection to ConcatOutputSection 2021-05-25 14:58:29 -04:00
Config.h [lld][MachO] Add first bits to support special symbols 2021-06-04 23:32:26 -07:00
Driver.cpp [lld/mac] Add reexports after reexporter to inputFiles 2021-06-07 17:04:03 -04:00
Driver.h [lld-macho][nfc] Remove unnecessary use of Optional<T*> 2021-06-01 18:35:31 -04:00
DriverUtils.cpp [lld/mac] Implement support for searching dylibs with @rpath/ in install name 2021-06-07 06:22:52 -04:00
Dwarf.cpp [lld-macho][NFC] define more strings in section_names:: and segment_names:: 2021-04-27 17:48:45 -07:00
Dwarf.h [lld-macho] Emit STABS symbols for debugging, and drop debug sections 2020-12-01 15:05:20 -08:00
ExportTrie.cpp [lld-macho][NFC] add const to pointer/reference induction variables of range-based for loops 2021-03-10 12:07:31 -08:00
ExportTrie.h [lld-macho] Export trie addresses should be relative to the image base 2020-09-20 20:43:15 -07:00
InputFiles.cpp [lld/mac] Add reexports after reexporter to inputFiles 2021-06-07 17:04:03 -04:00
InputFiles.h [lld/mac] Implement support for searching dylibs with @rpath/ in install name 2021-06-07 06:22:52 -04:00
InputSection.cpp [lld][MachO] Adjust isCodeSection signature 2021-05-17 22:09:47 -07:00
InputSection.h [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
LTO.cpp [lld-macho][nfc] Add accessors for commonly-used PlatformInfo fields 2021-04-21 15:43:56 -04:00
LTO.h [lld-macho] Add very basic support for LTO 2020-11-10 12:19:28 -08:00
MachOStructs.h [lld-macho] Add support for arm64_32 2021-04-15 21:16:33 -04:00
MapFile.cpp [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
MapFile.h [lld-macho] implement options -map 2021-03-18 10:39:19 -04:00
MarkLive.cpp [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
MarkLive.h [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
ObjC.cpp [lld-macho] De-templatize mach_header operations 2021-05-03 18:31:23 -04:00
ObjC.h [lld-macho] Implement -ObjC 2020-08-26 19:20:55 -07:00
Options.td [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
OutputSection.cpp [lld-macho] Refactor segment/section creation, sorting, and merging 2020-06-21 17:13:59 -07:00
OutputSection.h [lld-macho][nfc] Sort OutputSections based on explicit order of command-line inputs 2021-05-25 14:58:29 -04:00
OutputSegment.cpp [lld-macho][nfc] Remove unnecessary parameterization of section sort 2021-05-25 14:58:30 -04:00
OutputSegment.h [lld] Add missing includes (NFC) 2021-06-03 18:55:18 +02:00
Relocations.cpp [lld-macho][nfc] Remove DYSYM8 reloc attribute 2021-04-09 19:48:08 -04:00
Relocations.h [lld-macho] Add 32-bit compact unwind support 2021-04-15 21:16:33 -04:00
SymbolTable.cpp [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
SymbolTable.h [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
Symbols.cpp [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
Symbols.h [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
SyntheticSections.cpp [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
SyntheticSections.h [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
Target.cpp [lld-macho][nfc] Create Relocations.{h,cpp} for relocation-specific code 2021-03-11 13:28:09 -05:00
Target.h [lld-macho] Implement branch-range-extension thunks 2021-05-12 09:44:58 -07:00
UnwindInfoSection.cpp [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
UnwindInfoSection.h [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
Writer.cpp [lld/mac] Rename DylibFile::dylibName to DylibFile::installName 2021-06-06 20:00:35 -04:00
Writer.h [lld-macho] De-templatize mach_header operations 2021-05-03 18:31:23 -04:00