[yocto] [prelink-cross][patch] Fix ifunc on x86_64 x32

Andrew Stubbs ams at codesourcery.com
Fri Dec 9 09:34:46 PST 2016


Hi Mark,

The ifunc1, ifunc2, and ifunc3 tests currently fail on x86_64 x32 ABI 
because the testcase crashes at runtime. The testcases run fine when not 
prelinked.

In the case of ifunc1, the test tries to call the "lib2t2" function 
directly, instead of using it as an indirect call, which leads to the 
testcase aborting. In real code this would not cause an immediate crash, 
but presumably would lead to undefined behaviour.

The attached patch fixes the problem by converting R_X86_64_32 conflict 
relocations to R_X86_64_IRELATIVE (in the same way as R_X86_64_64 
relocations are).

I've tested this with the cross_prelink branch and a suitably configured 
cross-toolchain. I expect it would be fine on the master branch also, 
but I can't test that.

Andrew Stubbs
Mentor Graphics/CodeSourcery
-------------- next part --------------
A non-text attachment was scrubbed...
Name: prelink-fix-ifunc-on-x86_64-x32.patch
Type: text/x-patch
Size: 1125 bytes
Desc: not available
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20161209/edfc7f38/attachment.bin>


More information about the yocto mailing list