llvm-project/lld/ELF
Fangrui Song e973c1375e [ELF] Move the outSecOff addend from relocAlloc/relocNonAlloc/... to InputSectionBase::relocate
For an InputSection, the `buf` argument of `InputSectionBase::relocate` points
to the content of the containing OutputSection, instead of the content of the
InputSection itself, so `outSecOff` needs to be added in its callees.  This is
counter-intuitive and leads to many `- outSecOff` and `+ outSecOff`.

This patch makes `InputSection::writeTo` call `InputSectionBase::relocate` with
`outSecOff` added. relocAlloc/relocNonAlloc/relocateNonAllocForRelocatable can
thus be simplified now.

Updated test:

* non-abs-reloc.s: A minor offset bug is fixed for a diagnostic in `relocateNonAlloc`

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D85618
2020-08-11 08:06:38 -07:00
..
Arch [PowerPC] Support for R_PPC64_REL24_NOTOC calls where the caller has no TOC and the callee is not DSO local 2020-07-29 19:49:28 +00:00
AArch64ErrataFix.cpp [ELF] Move the outSecOff addend from relocAlloc/relocNonAlloc/... to InputSectionBase::relocate 2020-08-11 08:06:38 -07:00
AArch64ErrataFix.h [ELF] Fix variable names in comments after VariableName -> variableName change 2019-07-16 05:50:45 +00:00
ARMErrataFix.cpp [ELF] Move the outSecOff addend from relocAlloc/relocNonAlloc/... to InputSectionBase::relocate 2020-08-11 08:06:38 -07:00
ARMErrataFix.h [ELF][ARM] Implement --fix-cortex-a8 to fix erratum 657417 2019-09-16 09:38:38 +00: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 [ELF] Add --dependency-file option 2020-08-03 16:59:13 -07:00
DWARF.cpp [ELF] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -07:00
DWARF.h [DebugInfo] Do not hang when parsing a malformed .debug_pub* section. 2020-07-09 19:15:11 +07:00
Driver.cpp [ELF] --wrap: set isUsedInRegularObj of __wrap_ if it is defined or shared 2020-08-08 09:24:31 -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 [ELF]: --icf: don't fold sections referencing sections with LCDA after D84610 2020-08-07 13:42:25 -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 SHF_LINK_ORDER sections to have sh_link=0 2020-08-05 16:17:42 -07:00
InputFiles.h [ELF] Demote lazy symbols relative to a discarded section to Undefined 2020-06-09 11:27:34 -07:00
InputSection.cpp [ELF] Move the outSecOff addend from relocAlloc/relocNonAlloc/... to InputSectionBase::relocate 2020-08-11 08:06:38 -07:00
InputSection.h [ELF] --icf: don't fold text sections with LSDA 2020-08-05 09:16:28 -07:00
LTO.cpp Rename basic block sections options to be consistent. 2020-07-31 11:50:55 -07: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] Allow sections after a non-SHF_ALLOC section to be covered by PT_LOAD 2020-08-06 08:27:15 -07:00
LinkerScript.h [ELF][ARM] Support /DISCARD/ of subset of .ARM.exidx sections 2020-05-11 14:27:13 +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] Use namespace qualifiers (lld:: or elf::) instead of `namespace lld { namespace elf {` 2020-05-15 08:49:53 -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 [ELF] Add --dependency-file option 2020-08-03 16:59:13 -07:00
OutputSections.cpp [ELF] -r: rewrite SHT_GROUP content if some members are combined or discarded 2020-07-21 08:49: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] Rename canRelax to toExecRelax. NFC 2020-07-08 10:27:31 -07:00
Relocations.h LLD Support for Basic Block Sections 2020-04-07 06:55:57 -07: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] Refine --export-dynamic-symbol semantics to be compatible GNU ld 2.35 2020-06-01 11:30:03 -07:00
Symbols.h [LLD][ELF] Implement --discard-* for cases when -r or --emit-relocs are used. 2020-04-25 18:59:41 +07:00
SyntheticSections.cpp [ELF] Move the outSecOff addend from relocAlloc/relocNonAlloc/... to InputSectionBase::relocate 2020-08-11 08:06:38 -07:00
SyntheticSections.h [ELF] --icf: don't fold text sections with LSDA 2020-08-05 09:16:28 -07: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 [PowerPC] Implement R_PPC64_REL24_NOTOC local calls, callee requires a TOC 2020-07-20 17:46:49 +00:00
Thunks.cpp [PowerPC] Add compatibility check for PPC PLT stubs 2020-08-07 13:45:18 +00:00
Thunks.h [ELF][PPC32] Implement IPLT code sequence for non-preemptible IFUNC 2019-12-29 22:42:53 -08:00
Writer.cpp [ELF] Allow sections after a non-SHF_ALLOC section to be covered by PT_LOAD 2020-08-06 08:27:15 -07:00
Writer.h Revert "Revert r370635, it caused PR43241." 2019-09-06 15:57:24 +00:00

README.md

See docs/NewLLD.rst