[PATCH] D157020: [lld/ELF] Don't relax R_X86_64_(REX_)GOTPCRELX when offset is too far

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 27 13:42:31 PDT 2023


aeubanks added inline comments.


================
Comment at: lld/test/ELF/x86-64-gotpc-err.s:10
-
-# CHECK:      error: {{.*}}:(.text+0x2): relocation R_X86_64_GOTPCRELX out of range: 2147483655 is not in [-2147483648, 2147483647]; references '__stop_data'
-# CHECK-NEXT: error: {{.*}}:(.text+0x9): relocation R_X86_64_REX_GOTPCRELX out of range: 2147483648 is not in [-2147483648, 2147483647]; references '__stop_data'
----------------
MaskRay wrote:
> You move this into `x86-64-gotpc-relax-too-far.s` but lose this error.
> 
> We need another linker script to place `.got` far away from `.text` to retain coverage for this error.
> 
> 
Correct me if I'm wrong, but I don't think this was testing a far away `.got` and that's not what the original patch was doing: https://reviews.llvm.org/D93259.

I can add test coverage for that if you'd like though.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D157020/new/

https://reviews.llvm.org/D157020



More information about the llvm-commits mailing list