[PATCH] D27581: [ELF][I386] .got.plt entries for i386 should use the VA of the ifunc resolver function

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 8 10:32:07 PST 2016


peter.smith created this revision.
peter.smith added reviewers: ruiu, rafael.
peter.smith added a subscriber: llvm-commits.
Herald added a subscriber: aemerson.

The i386 ld.so expects the .got.slot entry that is relocated by a R_386_IRELATIVE relocation to point directly at the ifunc resolver and not the address of the PLT entry + 6 (thus entering the lazy resolver). This is also the case for ARM and I suspect it is because these use REL relocations and can't use the addend field to store the address of the ifunc resolver. If the lazy resolver is used we get an error message stating that only R_386_JUMP_SLOT is supported.

As ARM and i386 share the same code, I've removed the ARM specific test and added a writeIgotPlt() function that by default calls writeGotPlt(). ARM and i386 override this to write the address of the ifunc resolver.


https://reviews.llvm.org/D27581

Files:
  ELF/SyntheticSections.cpp
  ELF/Target.cpp
  ELF/Target.h
  test/ELF/gnu-ifunc-plt-i386.s

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27581.80781.patch
Type: text/x-patch
Size: 6698 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161208/69b5079a/attachment.bin>


More information about the llvm-commits mailing list