llvm-capstone/lld/test
Arthur Eubanks 9d6ec280fc [lld/ELF] Don't relax R_X86_64_(REX_)GOTPCRELX when offset is too far
For each R_X86_64_(REX_)GOTPCRELX relocation, check that the offset to the symbol is representable with 2^32 signed offset. If not, add a GOT entry for it and set its expr to R_GOT_PC so that we emit the GOT load instead of the relaxed lea. Do this in finalizeAddressDependentContent() where we iteratively attempt this (e.g. RISCV uses this for relaxation, ARM uses this to insert thunks).

Decided not to do the opposite of inserting GOT entries initially and removing them when relaxable because removing GOT entries isn't simple.

One drawback of this approach is that if we see any GOTPCRELX relocation, we'll create an empty .got even if it's not required in the end.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D157020
2023-10-04 13:03:56 -07:00
..
COFF [LLD] [COFF] Fix handling of comdat .drectve sections (#68116) 2023-10-04 10:54:50 +03:00
ELF [lld/ELF] Don't relax R_X86_64_(REX_)GOTPCRELX when offset is too far 2023-10-04 13:03:56 -07:00
MachO [lld] Fix REQUIRES line in new test 2023-09-27 19:55:16 -04:00
MinGW [LLD] [MinGW] Hook up more LTO options 2023-08-28 00:28:46 +03:00
Unit Re-land [LLD] Allow usage of LLD as a library 2023-06-19 07:35:11 -04:00
wasm [WebAssembly] Allow absolute symbols in the linking section (symbol table) (#67493) 2023-10-03 13:16:16 -07:00
CMakeLists.txt [LLD] [COFF] Warn about pseudo relocations that are too narrow 2023-07-11 23:43:34 +03:00
lit.cfg.py [lld][ELF] Support LoongArch 2023-07-25 17:06:07 +08:00
lit.site.cfg.py.in [lld] Make lit files relocatable 2023-06-20 13:16:20 -04:00