On 20. 03. 19 08:11, Florian Weimer wrote:
* Branko:
If one yould check that condition during dynamic linking or customized
dl-opening of a needed DSO, one could simply do all the needed job there
- ie
check the condition and relocate all the calls to foo to land on foo_A,
or foo_B etc.
That way, there would be no runtime speed penalties...
The GNU toolchain supports IFUNCs, which allow precisely this. Due to
the way ELF dynamic linking works, you still have the indirect
function call overhead, but this is present with or without IFUNCs
once cross shared object boundary.
Great. But it looks as it if needs to use PLT _always_, even for local
names as resolving function has to
be initially accessed there and then it decides which version of real
function should appear in that PLT slot.
Does this mean that I can't use that trick for local names that bypass
PLT, say when within the same DSO
function A needs to call optimized variant B_1/B_2etc ?