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

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 29 13:20:34 PDT 2023


MaskRay accepted this revision.
MaskRay added a comment.
This revision is now accepted and ready to land.

Final nits



================
Comment at: lld/ELF/Arch/X86_64.cpp:334
+            sec->getOutputSection()->addr + rel.offset, *rel.sym, rel.expr);
+        if (static_cast<int64_t>(v) == llvm::SignExtend64(v, 32))
+          continue;
----------------
`if (isInt<32>(v))`


================
Comment at: lld/test/ELF/x86-64-gotpc-relax-too-far.s:25
+_start:
+  movl __stop_data at GOTPCREL(%rip), %eax  # out of range
+  movq __stop_data at GOTPCREL(%rip), %rax  # out of range
----------------
Add an out-of-range `__start_data` to test two GOT entries?


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