llvm-project/lld/ELF
Fangrui Song 589e10f858 [ELF] Don't relax R_X86_64_GOTPCRELX if addend != -4
clang may produce `movl x@GOTPCREL+4(%rip), %eax` when loading the high 32 bits
of the address of a global variable in -fpic/-fpie mode.

If assembled by GNU as, the fixup emits an R_X86_64_GOTPCRELX with an
addend != -4. The instruction loads from the GOT entry with an offset
and thus it is incorrect to relax the instruction.

If assembled by the integrated assembler, we emit R_X86_64_GOTPCREL for
relocations that definitely cannot be relaxed (D92114), so this patch is not
needed.

This patch disables the relaxation, which is compatible with the implementation in GNU ld
("Add R_X86_64_[REX_]GOTPCRELX support to gas and ld").

Reviewed By: grimar, jhenderson

Differential Revision: https://reviews.llvm.org/D91993
2020-11-30 08:30:19 -08:00
..
Arch [ELF] Don't relax R_X86_64_GOTPCRELX if addend != -4 2020-11-30 08:30:19 -08: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 [ELF] Fix interaction between --unresolved-symbols= and --[no-]allow-shlib-undefined 2020-11-17 12:20:57 -08:00
DWARF.cpp [lib/Object] - Generalize the RelocationResolver API. 2020-11-20 10:32:49 +03:00
DWARF.h [ELF] --gdb-index: skip SHF_GROUP .debug_info 2020-08-13 09:11:01 -07:00
Driver.cpp [lld] Add --no-lto-whole-program-visibility 2020-11-24 16:46:08 -08: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 [lld/mac] Add --reproduce option 2020-11-30 08:40:21 -05: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][ELF] Add additional time trace categories 2020-11-10 10:28:46 +00: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] Don't consider SHF_ALLOC ".debug*" sections debug sections 2020-11-12 09:59:43 -08: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] Check --orphan-handling=place (default value) early 2020-11-29 12:36:27 -08:00
LinkerScript.h [LLD][ELF] Optimize linker script filename glob pattern matching NFC 2020-09-16 10:26:11 +01:00
MapFile.cpp [lld][ELF] Add additional time trace categories 2020-11-10 10:28:46 +00:00
MapFile.h [ELF] Add --print-archive-stats= 2020-04-29 18:04:37 -07:00
MarkLive.cpp [ELF] Improve 2 SmallVector<*, N> usage 2020-11-29 14:01:32 -08: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-link: Let LLD_REPRODUCE control /reproduce:, like in ld.lld 2020-11-27 13:33:55 -05:00
OutputSections.cpp [ELF] Make SORT_INIT_PRIORITY support .ctors.N 2020-11-12 08:56:12 -08:00
OutputSections.h [ELF] Improve 2 SmallVector<*, N> usage 2020-11-29 14:01:32 -08:00
README.md
Relocations.cpp [ELF] Rename adjustRelaxExpr to adjustTlsExpr and delete the unused `data` parameter. NFC 2020-11-25 09:00:55 -08: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 [ELF] Support multiple SORT in an input section description 2020-11-12 08:46:53 -08: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-exclude: use toString to match the documentation 2020-11-07 20:19:21 -08: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] Rename adjustRelaxExpr to adjustTlsExpr and delete the unused `data` parameter. NFC 2020-11-25 09:00:55 -08:00
Target.h [ELF] Rename adjustRelaxExpr to adjustTlsExpr and delete the unused `data` parameter. NFC 2020-11-25 09:00:55 -08: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] Fix interaction between --unresolved-symbols= and --[no-]allow-shlib-undefined 2020-11-17 12:20:57 -08:00
Writer.h Revert "Revert r370635, it caused PR43241." 2019-09-06 15:57:24 +00:00

README.md

See docs/NewLLD.rst