https://sourceware.org/bugzilla/show_bug.cgi?id=19031
Bug ID: 19031 Summary: R_386_PC32 does not imply a call Product: binutils Version: unspecified Status: NEW Severity: normal Priority: P2 Component: gold Assignee: ccoutant at gmail dot com Reporter: rafael.espindola at gmail dot com CC: amonakov at gmail dot com, bugdal at aerifal dot cx, hjl.tools at gmail dot com, ian at airs dot com Target Milestone: --- Created attachment 8652 --> https://sourceware.org/bugzilla/attachment.cgi?id=8652&action=edit testcase In order for function pointer comparisons to work when a non -fPIC non -fPIE program uses a shared library symbol the static linker has to create an undefined symbol with a value that points to the plt entry. Currently both gold and bfd ld assume that R_386_PC32 is a call and therefore doesn't capture the address, but there is no such guarantee in the psabi. The attached patch has two functions, g and h. g will get the function address of f using the GOT. h will get the function address of f using R_386_PC32. If f is linked in from a .o, both return the same value. If f is linked in from a .so one gets the body of f and another gets the plt entry. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ bug-binutils mailing list bug-binutils@gnu.org https://lists.gnu.org/mailman/listinfo/bug-binutils