[PATCH] D91965: Revert "[X86] Produce R_X86_64_GOTPCRELX for test/binop instructions (MOV32rm/TEST32rm/...) when -Wa,-mrelax-relocations=yes is enabled"

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 23 11:36:06 PST 2020


MaskRay added a comment.

This a pre-existing problem with GNU as:

- X86MCInstLower.cpp emits `movl    otherfunction at GOTPCREL+4(%rip), %eax`
- This fixup does not work if both R_X86_64_GOTPCRELX (new integrated assembler behavior, also GNU as's) and LLD are used.

`otherfunction at GOTPCREL+4` is a bit weird as it emits a GOT entry for `otherfunction` but accesses the high 4 bytes of the GOT entry. It can work if the linker allows it as in GNU ld.
GNU ld does not relax R_X86_64_GOTPCRELX if the addend if not -4.

I'll try fixing LLD instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91965



More information about the llvm-commits mailing list