http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51643

--- Comment #14 from Richard Earnshaw <rearnsha at gcc dot gnu.org> 2011-12-22 
23:27:29 UTC ---
Because the ABI says it only works for bare metal.

On a system with shared libraries, you can't tell at static link time if a weak
symbol will be resolved by a shared library, so it has to left up to the
dynamic linker which will fill in a PLT stub.  Once you have those, it's pretty
hard to make the call become a stub (and even if it were, it wouldn't be a NOP
(the linker would have to turn the call into something that simply returned as
the PLT sequence can't be patched).  Tail-calling PLT sequences is perfectly
safe, so there's no reason not to perform the optimization.

Reply via email to