https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88954
nsz at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nsz at gcc dot gnu.org --- Comment #7 from nsz at gcc dot gnu.org --- note that with void f_noplt(void) __attribute__((noplt)); void (*p)(void) = f_noplt; the linker may create a PLT for f_noplt and use its address to initialize p in case of non-pie linking. alternatively the linker may emit a dynamic relocation for p so it is filled in by the dynamic linker to the actual address of f_noplt. it seems the bfd linker on x86_64 does the latter (if there is otherwise no PLT), but e.g. the gold linker does the former. (as far as the sysv abi is concerned both behaviours are correct, the linker does not know about the noplt attr.) this means that (depending on linker behaviour) a noplt function may get a PLT in non-pie executables (so noplt can only avoid lazy binding and jump slot relocs reliably in pic code), may be linkers should be fixed so noplt always avoids PLT (on x86_64, other targets have other issues with non-pic), but then this has to be abi to be reliable.