hanchenye-llvm-project/lld/MachO
Nico Weber 54418c5a35 [lld/mac] Make binaries written by lld strippable
Be less clever when writing the indirect symbols in LC_DYSYMTAB:
lld used to make point __stubs and __la_symbol_ptr point at the
same bytes in the indirect symbol table in the __LINKEDIT segment.
That confused strip, so write the same bytes twice and make
__stubs and __la_symbol_ptr point at one copy each, so that they
don't share data. This unconfuses strip, and seems to be what ld64
does too, so hopefully tools are generally more used to this.

This makes the output binaries a bit larger, but not much: 4 bytes
for roughly each called function from a dylib and each weak function.
Chromium Framewoork grows by 6536 bytes, clang-format by a few hundred.

With this, `strip -x Chromium\ Framework` works (244 MB before stripping
to 171 MB after stripping, compared to 236 MB=>164 MB with ld64). Running
strip without `-x` produces the same error message now for lld-linked
Chromium Framework as for when using ld64 as a linker.

`strip clang-format` also works now but didn't previously.

Fixes PR50657.

Differential Revision: https://reviews.llvm.org/D104081
2021-06-11 00:18: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-macho] Implement cstring deduplication 2021-06-07 23:48:35 -04:00
ConcatOutputSection.h [lld-macho] Implement cstring deduplication 2021-06-07 23:48:35 -04:00
Config.h [lld/mac] Print dylib search details with --print-dylib-search or RC_TRACE_DYLIB_SEARCHING 2021-06-09 22:08:20 -04:00
Driver.cpp [lld/mac] Print dylib search details with --print-dylib-search or RC_TRACE_DYLIB_SEARCHING 2021-06-09 22:08:20 -04:00
Driver.h [lld/mac] Print dylib search details with --print-dylib-search or RC_TRACE_DYLIB_SEARCHING 2021-06-09 22:08:20 -04:00
DriverUtils.cpp [lld/mac] Print dylib search details with --print-dylib-search or RC_TRACE_DYLIB_SEARCHING 2021-06-09 22:08:20 -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
ExportTrie.cpp
ExportTrie.h
InputFiles.cpp [lld/mac] When handling @loader_path, use realpath() of symlinks 2021-06-09 20:36:07 -04:00
InputFiles.h [lld-macho] Implement cstring deduplication 2021-06-07 23:48:35 -04:00
InputSection.cpp [lld-macho] Implement cstring deduplication 2021-06-07 23:48:35 -04:00
InputSection.h [lld-macho][nfc] Fix uninitialized members warning from Coverity 2021-06-10 15:09:07 -04:00
LTO.cpp [lld-macho][nfc] Add accessors for commonly-used PlatformInfo fields 2021-04-21 15:43:56 -04:00
LTO.h
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
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
Options.td [lld/mac] Print dylib search details with --print-dylib-search or RC_TRACE_DYLIB_SEARCHING 2021-06-09 22:08:20 -04:00
OutputSection.cpp
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
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-macho] Implement cstring deduplication 2021-06-07 23:48:35 -04:00
Symbols.h [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
SyntheticSections.cpp [lld/mac] Make binaries written by lld strippable 2021-06-11 00:18:03 -04:00
SyntheticSections.h [lld-macho] Implement cstring deduplication 2021-06-07 23:48:35 -04:00
Target.cpp
Target.h [lld-macho] Implement branch-range-extension thunks 2021-05-12 09:44:58 -07:00
UnwindInfoSection.cpp [lld-macho] Implement cstring deduplication 2021-06-07 23:48:35 -04:00
UnwindInfoSection.h [lld/mac] Implement -dead_strip 2021-06-02 11:09:26 -04:00
Writer.cpp [lld-macho] Implement cstring deduplication 2021-06-07 23:48:35 -04:00
Writer.h [lld-macho] De-templatize mach_header operations 2021-05-03 18:31:23 -04:00