https://sourceware.org/bugzilla/show_bug.cgi?id=22883
Bug ID: 22883
Summary: Gold mis-evaluates R_X86_64_PLT32 reloc
Product: binutils
Version: 2.31 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: gold
Assignee: ccoutant at gmail dot com
Reporter: nickc at redhat dot com
CC: ian at airs dot com
Target Milestone: ---
Created attachment 10845
--> https://sourceware.org/bugzilla/attachment.cgi?id=10845&action=edit
Object files and shell script to demonstaret the bug
Hi Guys,
It appears that Gold can mis-evaluate a R_X86_64_PLT32 reloc, creating an
invalid executable:
% objdump -dr pscopyca.o
[...]
2d1: e8 fc ff ff ff callq 2d2 <mx_ippsZero_16s+0x14>
2d2: R_X86_64_PLT32 mx_ownsZero_8u
[...]
% gcc codectest.c.o pscopyca.o -o gold.exe -fuse-ld=gold
% ./gold.exe
Segmentation fault (core dumped)
% objdump -d gold.exe
[...]
4007d9: e8 36 ff ff ff callq 400714 <mx_ownsZero_8u+0x4>
[...]
So the callq instruction branches into the middle of the mx_ownsZero_8u
function.
By contract the bfd linker generates a working binary, with a correct
call to mx_ownsZero_8u:
% objdump -d bfd.exe
[...]
400779: e8 32 ff ff ff callq 4006b0 <mx_ownsZero_8u>
[...]
Cheers
Nick
PS. This bug has also been reported on the Fedora bigzilla system:
https://bugzilla.redhat.com/show_bug.cgi?id=1547747
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-binutils