It seems there was some concern about the ODR wrt. my previous
similar patch; this version uses referenced libraries '.direct'
section to detect vague symbols, and in the absence of that marks them
'unknown' and doesn't do direct linkage on them. ie. this works nicely
In addition - there was a concern about the movement of symbols
from 1 library to another as a result of re-factoring. This is not an
issue since if a direct lookup fails, we fallback to the good 'ole
lookup algorithm which will of course behave as normal.
This .gnu.linkonce based detection is far more robust &
conservative than the previous regexp based checking, though we now do
slow lookups for a load of _ZThn.* relocations which is not really
necessary. The innovative new option name is to reflect these crucial
differences from the Solaris -Bdirect feature.
So - further thoughts & comment much appreciated; Jakub cc'd you,
hope that's ok - would value your advice as a linker expert. Of course
it'd be nice to have some further annotation for extra linker control
for deliberate use of ELF interposing - clearly some libraries
(eg. glibc) rely on that a lot; not be suitable for use there in it's
+ How are new elf sections allocated ? and/or typically named
I know DT_DIRECT / '.direct' are prolly beyond the pale
The Solaris linker uses a .SUNW_syminfo section.
+ LD_PRELOADs need handling for the direct dl-lookup.c
case ? but that requires a search scope; prolly easy to
provide: just use the 1st N entries of existing searchlist
+ the dl-deps.c change requires re-work on advice - it sucks.
+ should the compiler generate better per-symbol 'vagueness'
markup for binutils to avoid using others' .direct sections.
+ others I havn't thought of.
+ propagate vagueness from other libraries instead of
hard-coded broken regexp
+ add LD_BIND_DIRECT env. var to help profiling