https://sourceware.org/bugzilla/show_bug.cgi?id=31171
Bug ID: 31171 Summary: ld generates gratuitous PLT entries on ARM Product: binutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: ld Assignee: unassigned at sourceware dot org Reporter: bugdal at aerifal dot cx Target Milestone: --- This looks like it may be the same as https://sourceware.org/bugzilla/show_bug.cgi?id=22374 for other archs. I was testing with the program: #include <stdlib.h> static void (*f)() = abort; int main() { return (long)f; } built with -O0 so there's no attempt at determining that f doesn't change and inlining it. The emitted asm and .o file clearly do not contain any references to abort from .text; however, the linked executable has JUMP_SLOT relocations and abort@plt instructions. Both 32-bit arm and aarch64 are affected. The condition for generating a PLT entry (and analogously, for data, a copy relocation) should be that the symbol is referenced from text, not that it's a function-type symbol being referenced at all. References from data do not need PLT entries or copy relocations. -- You are receiving this mail because: You are on the CC list for the bug.