* 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.