llvm-project/lld/ELF
Fangrui Song 2fc704a0a5 [ELF] --emit-relocs: fix st_value of STT_SECTION in the presence of a gap before the first input section
In the presence of a gap, the st_value field of a STT_SECTION symbol is the
address of the first input section (incorrect if there is a gap). Set it to the
output section address instead.

In -r mode, this bug can cause an incorrect non-zero st_value of a STT_SECTION
symbol (while output sections have zero addresses, input sections may have
non-zero outSecOff).  The non-zero st_value can cause the final link to have
incorrect relocation computation (both GNU ld and LLD add st_value of the
STT_SECTION symbol to the output section address).

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D90520
2020-11-02 08:37:15 -08:00
..
Arch [ELF] Don't crash on R_X86_64_GOTPCRELX for test/binop instructions 2020-10-24 15:14:17 -07:00
AArch64ErrataFix.cpp [ELF] Move the outSecOff addend from relocAlloc/relocNonAlloc/... to InputSectionBase::relocate 2020-08-11 08:06:38 -07:00
AArch64ErrataFix.h [LLD][ELF] Optimize linker script filename glob pattern matching NFC 2020-09-16 10:26:11 +01:00
ARMErrataFix.cpp [ELF] Move the outSecOff addend from relocAlloc/relocNonAlloc/... to InputSectionBase::relocate 2020-08-11 08:06:38 -07:00
ARMErrataFix.h [LLD][ELF] Optimize linker script filename glob pattern matching NFC 2020-09-16 10:26:11 +01:00
CMakeLists.txt [CMake] Make `intrinsics_gen` dependency unconditional. 2020-07-17 16:43:17 -07:00
CallGraphSort.cpp [COFF] Port CallGraphSort to COFF from ELF 2020-07-30 15:21:44 -07: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 [LLD][PowerPC] Implement GOT to PC-Rel relaxation 2020-08-17 09:36:09 -05:00
DWARF.cpp [ELF] --gdb-index: skip SHF_GROUP .debug_info 2020-08-13 09:11:01 -07:00
DWARF.h [ELF] --gdb-index: skip SHF_GROUP .debug_info 2020-08-13 09:11:01 -07:00
Driver.cpp [ELF] Don't change binding to STB_WEAK for an undefined specified by -u 2020-10-08 08:31:34 -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 [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07:00
EhFrame.cpp [ELF] Support .cfi_signal_frame 2020-08-07 22:08:44 -07:00
EhFrame.h [ELF] --icf: don't fold text sections with LSDA 2020-08-05 09:16:28 -07:00
ICF.cpp [LLD][ELF] Improve ICF for relocations to ineligible sections via "aliases" 2020-10-15 12:43:14 +01: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 LLD/AMDGPU: Infer os abi based on input llvm bitcode 2020-10-13 12:20:28 -04:00
InputFiles.h [LLD][ELF] Optimize linker script filename glob pattern matching NFC 2020-09-16 10:26:11 +01:00
InputSection.cpp [lib/Object] - Refine interface of ELFFile<ELFT>. NFCI. 2020-09-15 11:38:31 +03:00
InputSection.h [ELF] --icf: don't fold text sections with LSDA 2020-08-05 09:16:28 -07:00
LTO.cpp Flush bitcode incrementally for LTO output 2020-09-17 03:32:31 +00: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] -r: don't crash when a non-SHF_LINK_ORDER orphan is added before a SHF_LINK_ORDER orphan 2020-10-28 08:56:42 -07:00
LinkerScript.h [LLD][ELF] Optimize linker script filename glob pattern matching NFC 2020-09-16 10:26:11 +01:00
MapFile.cpp [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07:00
MapFile.h [ELF] Add --print-archive-stats= 2020-04-29 18:04:37 -07:00
MarkLive.cpp [ELF] --gc-sections: retain dependent sections of non-SHF_ALLOC sections 2020-10-21 10:11:26 -07: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 [LLD] [ELF] Fix the help listing for the wrap option. NFC. 2020-10-09 15:32:00 +03:00
OutputSections.cpp [ELF] -r: allow SHT_X86_64_UNWIND to be merged into SHT_PROGBITS 2020-08-13 08:14:45 -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 [ELF] Don't error on R_PPC64_REL24/R_PPC64_REL24_NOTOC referencing __tls_get_addr for missing R_PPC64_TLSGD/R_PPC64_TLSLD 2020-10-23 10:38:07 -07:00
Relocations.h [LLD][ELF] Optimize linker script filename glob pattern matching NFC 2020-09-16 10:26:11 +01:00
ScriptLexer.cpp [LLD][ELF] - Linkerscript: report location for the "unclosed comment in a linker script" error. 2020-07-24 11:38:26 +03:00
ScriptLexer.h [LLD][ELF] - Linkerscript: report location for the "unclosed comment in a linker script" error. 2020-07-24 11:38:26 +03:00
ScriptParser.cpp [lld][linkerscript] Fix handling of DEFINED. 2020-07-28 21:18:01 +01:00
ScriptParser.h [ELF] Improve --export-dynamic-symbol performance by checking whether wildcard is really used 2020-06-17 17:12:10 -07:00
SymbolTable.cpp [ELF] --wrap: don't leave the original symbol as SHN_UNDEF in .symtab or .dynsym 2020-08-08 18:18:20 -07:00
SymbolTable.h [ELF] Replace SymbolTable::forEachSymbol with iterator_range symbols() 2019-11-26 09:09:32 -08:00
Symbols.cpp [ELF] --warn-backrefs: save the referenced InputFile * 2020-10-22 15:27:19 -07:00
Symbols.h [ELF] --warn-backrefs: save the referenced InputFile * 2020-10-22 15:27:19 -07:00
SyntheticSections.cpp [ELF] --emit-relocs: fix st_value of STT_SECTION in the presence of a gap before the first input section 2020-11-02 08:37:15 -08:00
SyntheticSections.h [ELF] Handle SHT_RISCV_ATTRIBUTES similarly to SHT_ARM_ATTRIBUTES 2020-09-05 18:36:23 +01:00
Target.cpp [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07:00
Target.h [ELF] Define a reportRangeError() overload for thunks and tidy up recent PPC64 thunk range errors 2020-09-14 09:55:59 -07:00
Thunks.cpp [PowerPC][LLD] Extend R2 save stub to support offsets of more than 26 bits 2020-09-25 06:39:14 -05:00
Thunks.h [ELF][PPC32] Implement IPLT code sequence for non-preemptible IFUNC 2019-12-29 22:42:53 -08:00
Writer.cpp [ELF] --emit-relocs: fix st_value of STT_SECTION in the presence of a gap before the first input section 2020-11-02 08:37:15 -08:00
Writer.h Revert "Revert r370635, it caused PR43241." 2019-09-06 15:57:24 +00:00

README.md

See docs/NewLLD.rst