aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Format/WhitespaceManager.cpp
diff options
context:
space:
mode:
authorArthur Eubanks <aeubanks@google.com>2023-08-03 11:00:24 -0700
committerArthur Eubanks <aeubanks@google.com>2023-10-04 13:03:56 -0700
commit9d6ec280fc537b55ef8641ea85d3522426bc5766 (patch)
treed38dc25e9d31bb5fb6ceb02e472585689686fb64 /clang/lib/Format/WhitespaceManager.cpp
parentbfcfc2a6d43f9cd86d66e7e68c03f3200bb1e366 (diff)
downloadllvm-9d6ec280fc537b55ef8641ea85d3522426bc5766.zip
llvm-9d6ec280fc537b55ef8641ea85d3522426bc5766.tar.gz
llvm-9d6ec280fc537b55ef8641ea85d3522426bc5766.tar.bz2
[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
Diffstat (limited to 'clang/lib/Format/WhitespaceManager.cpp')
0 files changed, 0 insertions, 0 deletions