On Tue, Jun 17, 2014 at 12:50 PM, Jan Hubicka <hubi...@ucw.cz> wrote: >> > To avoid using PLT and GOT when the unit refers to the symbol and we know >> > that interposition does not matter. >> >> I am not certain if the linker is creating the PLT stub code because >> it wants to allow interpolation or because it cannot see a definition >> of the function and wants to allow for some other shared library to >> provide the definition at runtime. > > OK, but the definition appears in the same file.. >> >> > Why branch to a non-global (static) symbol >> > b ._ZN14__gnu_parallel9_SettingsC1Ev.localalias.0 >> > leads to PLT stub here and why branching to such symbols seems to work >> > otherwise? >> >> Branching to non-global (static) symbol, even an alias, is working >> here. The weak function seems to be the problem.
The weak function is the problem, but I don't know why. And I don't understand how this is different than past uses of weak functions. Or is that new? This is very confusing because the library, libstdc++, is being linked statically. It provides a weak definition of the function. There should be no glink code (PLT stub). If the function is declared .lglobl, it is called directly and no PLT stub is created. I need to call in the help of the AIX linker expert to figure out why it is inserting PLT stub code, especially when linking statically. Thanks, David