llvm/lld/MachO
Nico Weber 10cda6e36c [lld/mac] Give range extension thunks for local symbols local visibility
When two local symbols (think: file-scope static functions, or functions in
unnamed namespaces) with the same name in two different translation units
both needed thunks, ld64.lld previously created external thunks for both
of them. These thunks ended up with the same name, leading to a duplicate
symbol error for the thunk symbols.

Instead, give thunks for local symbols local visibility.

(Hitting this requires a jump to a local symbol from over 128 MiB away.
It's unlikely that a single .o file is 128 MiB large, but with ICF
you can end up with a situation where the local symbol is ICF'd with
a symbol in a separate translation unit. And that can introduce a
large enough jump to require a thunk.)

Fixes PR54599.

Differential Revision: https://reviews.llvm.org/D122624
2022-03-30 16:45:05 -04:00
..
Arch [lld-macho][nfc] Allow Defined symbols to be placed in binding sections 2022-03-14 22:18:32 -04:00
CMakeLists.txt
ConcatOutputSection.cpp [lld/mac] Give range extension thunks for local symbols local visibility 2022-03-30 16:45:05 -04:00
ConcatOutputSection.h
Config.h [lld][Macho][NFC] Encapsulate priorities map in a priority class 2022-03-23 13:57:26 -04:00
Driver.cpp [lld][Macho][NFC] Encapsulate priorities map in a priority class 2022-03-23 13:57:26 -04:00
Driver.h
DriverUtils.cpp
Dwarf.cpp
Dwarf.h
ExportTrie.cpp Reland "[lld-macho] Avoid using bump-alloc in TrieBuider"" 2022-03-14 19:33:13 -04:00
ExportTrie.h Reland "[lld-macho] Avoid using bump-alloc in TrieBuider"" 2022-03-14 19:33:13 -04:00
ICF.cpp [lld-macho] Don't allocate memory in parallelForEach 2022-03-11 13:32:24 -05:00
ICF.h
InputFiles.cpp [lld-macho][nfc] Have findContainingSubsection take a Section 2022-03-21 07:23:09 -04:00
InputFiles.h [lld-macho][nfc] Have findContainingSubsection take a Section 2022-03-21 07:23:09 -04:00
InputSection.cpp [lld-macho] Deduplicate the __objc_classrefs section contents 2022-03-08 08:34:04 -05:00
InputSection.h [lld-macho] Deduplicate the __objc_classrefs section contents 2022-03-08 08:34:04 -05:00
ld64-vs-lld.rst [lld-macho][nfc] Fix formatting in ld64-vs-lld.rst 2022-03-10 18:33:18 -05:00
LTO.cpp [lld-macho] Set FinalDefinitionInLinkageUnit on most LTO externs 2022-03-15 20:25:06 -04:00
LTO.h
MachOStructs.h
MapFile.cpp
MapFile.h
MarkLive.cpp [lld-macho][nfc] Add comment explaining why a cast<> is safe 2022-03-21 07:23:09 -04:00
MarkLive.h
ObjC.cpp
ObjC.h
Options.td [lld-macho] Implement -why_live (without perf overhead) 2022-02-24 15:49:36 -05:00
OutputSection.cpp
OutputSection.h
OutputSegment.cpp
OutputSegment.h
Relocations.cpp [lld-macho] Have relocation address included in range-check error message 2022-02-28 21:56:38 -05:00
Relocations.h [lld-macho] Have relocation address included in range-check error message 2022-02-28 21:56:38 -05:00
SectionPriorities.cpp [lld][Macho][NFC] Encapsulate priorities map in a priority class 2022-03-23 13:57:26 -04:00
SectionPriorities.h [lld][Macho][NFC] Encapsulate priorities map in a priority class 2022-03-23 13:57:26 -04:00
Symbols.cpp [lld-macho] -flat_namespace for dylibs should make all externs interposable 2022-03-14 22:18:32 -04:00
Symbols.h [lld-macho] -flat_namespace for dylibs should make all externs interposable 2022-03-14 22:18:32 -04:00
SymbolTable.cpp [lld-macho] -flat_namespace for dylibs should make all externs interposable 2022-03-14 22:18:32 -04:00
SymbolTable.h
SyntheticSections.cpp [lld-macho][nfc] Don't mix file sizes with addresses 2022-03-22 17:52:53 -04:00
SyntheticSections.h [lld-macho][nfc] Allow Defined symbols to be placed in binding sections 2022-03-14 22:18:32 -04:00
Target.cpp
Target.h [lld-macho][nfc] Allow Defined symbols to be placed in binding sections 2022-03-14 22:18:32 -04:00
UnwindInfoSection.cpp
UnwindInfoSection.h
Writer.cpp [lld][Macho][NFC] Encapsulate priorities map in a priority class 2022-03-23 13:57:26 -04:00
Writer.h