[PATCH] D91993: [ELF] Don't relax R_X86_64_GOTPCRELX if addend != -4

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 25 08:49:31 PST 2020


MaskRay added a comment.

In D91993#2416238 <https://reviews.llvm.org/D91993#2416238>, @jhenderson wrote:

> FWIW, I'm with @grimar in the sense that I think this is poor and unnecessary behaviour provided for by the psABI. Why emit the relocation type in this context, when the primary purpose (assuming I'm not mistaken) of this relocation type is to enable relaxations? Why not emit the generic GOTPCREL relocation?

MC could emit R_X86_64_GOTPCREL in this case. Then call GNU as' emitting R_X86_64_GOTPCRELX a bug?

Hmm, I think the assembler behavior is fine, because R_X86_64_GOTPCREL in all cases can be replaced by R_X86_64_GOTPCRELX and R_X86_64_REX_GOTPCRELX, if the user does not mind the instructions are relaxed.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91993



More information about the llvm-commits mailing list