llvm-project/lld/ELF
Fangrui Song c1c679e2d2 [ELF] Make --version-script/--dynamic-list work for lazy symbols fetched by LTO libcalls
Fixes https://bugs.llvm.org/show_bug.cgi?id=45391

The LTO code generator happens after version script scanning and may
create references which will fetch some lazy symbols.

Currently a version script does not assign VER_NDX_LOCAL to lazy symbols
and such symbols will be made global after they are fetched.

Change findByVersion and findAllByVersion to work on lazy symbols.
For unfetched lazy symbols, we should keep them non-local (D35263).
Check isDefined() in computeBinding() as a compensation.

This patch fixes a companion bug that --dynamic-list does not export
libcall fetched symbols.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D77280
2020-04-06 09:47:06 -07:00
..
Arch [lld] NFC: fix trivial typos in comments 2020-04-02 01:21:36 +09:00
AArch64ErrataFix.cpp [ELF] Rename relocateOne() to relocate() and pass `Relocation` to it 2020-01-25 12:00:18 -08:00
AArch64ErrataFix.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
ARMErrataFix.cpp [ELF] Rename relocateOne() to relocate() and pass `Relocation` to it 2020-01-25 12:00:18 -08:00
ARMErrataFix.h [ELF][ARM] Implement --fix-cortex-a8 to fix erratum 657417 2019-09-16 09:38:38 +00:00
CMakeLists.txt [ThinLTO] Pass CodeGenOpts like UnrollLoops/VectorizeLoop/VectorizeSLP 2020-01-09 21:13:11 -08:00
CallGraphSort.cpp [lld] NFC: fix trivial typos in comments 2020-04-02 01:21:36 +09:00
CallGraphSort.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Config.h [ThinLTO] Allow usage of all hardware threads in the system 2020-03-27 10:20:58 -04:00
DWARF.cpp [LLD][NFC] Remove getOffsetInFile() workaround. 2020-03-05 15:52:46 +03:00
DWARF.h gdb-index: Wire up str_offsets section to avoid incorrect error message about offsets_base 2019-08-07 22:49:14 +00:00
Driver.cpp [lld][COFF][ELF][WebAssembly] Replace --[no-]threads /threads[:no] with --threads={1,2,...} /threads:{1,2,...} 2020-03-31 08:46:12 -07:00
Driver.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
DriverUtils.cpp Remove unused Endian.h includes, NFC 2020-03-11 15:45:34 -07:00
EhFrame.cpp [ELF] Wrap things in `namespace lld { namespace elf {`, NFC 2019-10-07 08:31:18 +00:00
EhFrame.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
ICF.cpp [lld][COFF][ELF][WebAssembly] Replace --[no-]threads /threads[:no] with --threads={1,2,...} /threads:{1,2,...} 2020-03-31 08:46:12 -07:00
ICF.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
InputFiles.cpp [ELF] Allow invalid sh_size%sh_entsize!=0 for non-SHF_MERGE sections 2020-04-03 08:48:30 -07:00
InputFiles.h LLD already has a mechanism for caching creation of DWARCContext: 2020-03-06 21:17:07 +03:00
InputSection.cpp [lld] NFC: fix trivial typos in comments 2020-04-02 01:21:36 +09:00
InputSection.h [ELF] Fix a null pointer dereference when --emit-relocs and --strip-debug are used together 2020-02-13 08:56:38 -08:00
LTO.cpp [ThinLTO] Allow usage of all hardware threads in the system 2020-03-27 10:20:58 -04:00
LTO.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
LinkerScript.cpp [ELF] Propagate LMA offset to sections with neither AT() nor AT> 2020-04-01 08:19:06 -07:00
LinkerScript.h [ELF] Simplify sh_addr computation and warn if sh_addr is not a multiple of sh_addralign 2020-03-11 09:35:42 -07:00
MapFile.cpp Make it possible to redirect not only errs() but also outs() 2019-11-18 11:18:06 +09:00
MapFile.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
MarkLive.cpp [LLD][ELF] Add time-trace to ELF LLD 2020-02-06 12:14:13 +00:00
MarkLive.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Options.td [ELF] Change some "Alias for " help messages to use double dashed options 2020-04-02 09:27:56 -07:00
OutputSections.cpp [ELF] Allow SHF_LINK_ORDER and non-SHF_LINK_ORDER to be mixed 2020-03-30 10:03:55 -07:00
OutputSections.h [ELF] Refactor uses of getInputSections to improve efficiency NFC 2020-01-21 12:27:52 +00:00
README.md
Relocations.cpp [Hexagon] Fix issue with non-preemptible STT_TLS symbols 2020-04-03 08:55:23 -05:00
Relocations.h [LLD][ELF][Hexagon] Support GDPLT transforms 2020-03-13 11:02:11 -05:00
ScriptLexer.cpp [lld] NFC: fix trivial typos in comments 2020-04-02 01:21:36 +09:00
ScriptLexer.h [Coding style change] Rename variables so that they start with a lowercase letter 2019-07-10 05:00:37 +00:00
ScriptParser.cpp [lld][ELF] Mark empty NOLOAD output sections SHT_NOBITS instead of SHT_PROGBITS 2020-03-28 10:07:58 -07:00
ScriptParser.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
SymbolTable.cpp [ELF] Make --version-script/--dynamic-list work for lazy symbols fetched by LTO libcalls 2020-04-06 09:47:06 -07:00
SymbolTable.h [ELF] Replace SymbolTable::forEachSymbol with iterator_range symbols() 2019-11-26 09:09:32 -08:00
Symbols.cpp [ELF] Make --version-script/--dynamic-list work for lazy symbols fetched by LTO libcalls 2020-04-06 09:47:06 -07:00
Symbols.h [ELF] Print symbols with non-default versions for better "undefined symbol" diagnostics 2020-04-01 08:04:36 -07:00
SyntheticSections.cpp [lld] NFC: fix trivial typos in comments 2020-04-02 01:21:36 +09:00
SyntheticSections.h [lld] NFC: fix trivial typos in comments 2020-04-02 01:21:36 +09:00
Target.cpp Make llvm::StringRef to std::string conversions explicit. 2020-01-28 23:25:25 +01:00
Target.h [ELF] Mention symbol name in reportRangeError() 2020-01-29 09:38:25 -08:00
Thunks.cpp [ELF][PPC64] Enable R_PPC64_REL14 trunks 2020-04-04 10:59:17 -07:00
Thunks.h [ELF][PPC32] Implement IPLT code sequence for non-preemptible IFUNC 2019-12-29 22:42:53 -08:00
Writer.cpp [LLD][ELF] Allow empty (.init|.preinit|.fini)_array to be RELRO 2020-03-31 12:53:12 +01:00
Writer.h Revert "Revert r370635, it caused PR43241." 2019-09-06 15:57:24 +00:00

README.md

See docs/NewLLD.rst