https://gcc.gnu.org/bugzilla/show_bug.cgi?id=12306
Rich Felker <bugdal at aerifal dot cx> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugdal at aerifal dot cx --- Comment #8 from Rich Felker <bugdal at aerifal dot cx> --- I think this should be closed as not a bug. There is no contract that, on function entry, the r12 register contain the callee's GOT pointer. Rather it contains the caller's GOT pointer, and the two will only be equal if both reside in the same DSO. (Note that PowerPC64 ELFv2 ABI goes to great lengths to optimize this case with "local entry point" and fancy ABI contract for how the GOT pointer save/load can be elided. I'm not sure the benefits are well-documented though.)