[PATCH] D54145: [ELF] - Fix R_X86_64_GOTPCRELX/R_X86_64_REX_GOTPCRELX when target is IFUNC.

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 6 07:31:41 PST 2018


peter.smith added a comment.

In https://reviews.llvm.org/D54145#1288767, @grimar wrote:

> In https://reviews.llvm.org/D54145#1288739, @peter.smith wrote:
>
> > I've tested this out on X86, Arm and AArch64 and it works for X86 and Arm. Unfortunately it doesn't seem to work with AArch64 yet. I don't see any R_AARCH64_IRELATIVE relocations.
> >
> > I haven't found out why as yet. I'll do some digging to see if there is anything obvious that we are missing. If you have access to a X86 Linux box this is reproducible with a GCC aarch64-linux-gnu cross compilation toolchain and the linux user mode emulator qemu-aarch64.
>
>
> Thanks! My quick guess is that perhaps some new `Expr` is passed to `toPlt(RelExpr Expr)` for `AArch64` case and hence condition `if (needsPlt(Expr) && !Sym.isInPlt()) ` is not satisfied.
>  I'll try to take a look at what is going on there during this week.


Yes I agree. It looks like AArch64 uses R_AARCH64_ADR_GOT_PAGE which translates to R_GOT_PAGE_PC. Whereas on ARM we have R_ARM_GOT_PREL which translates to R_GOT_PC. So at a first approximation it looks like adding support for R_GOT_PAGE_PC_PLT might work.


https://reviews.llvm.org/D54145





More information about the llvm-commits mailing list