DT_FILTER/DT_AUXILIARY handling in glibc

Jakub Jelinek jakub@redhat.com
Thu May 17 04:22:00 GMT 2001


Hi!

I went a little bit further and read the linker guide and it looks like
glibc DT_FILTER/DT_AUXILIARY handling is incompatible with Solaris.
Is that different on purpose?
My understanding of glibc implementation is that DT_FILTER is like DT_NEEDED
but it comes in the search scope before the library dependant on it,
DT_AUXILIARY is like DT_FILTER except that the library does not have to
exist. On Solaris, on the other side, DT_FILTER puts that library in a
special search scope (together with its dependencies) and iff a symbol
is found in the library having the DT_FILTER tag, then search continues in
the DT_FILTER's library scope, if it is not found, search continues after
the library with DT_FILTER tag (ala RTLD_NEXT). DT_AUXILIARY is similar,
except a) the library does not have to be present b) if the symbol is not
found in DT_AUXILIARY's scope, the symbol from the library having
DT_AUXILIARY tag is returned (ala RTLD_SELF).
In the attached testcase, it gives with glibc:
test
foo a
bar a
baz a
dummy b
test2
foo a
bar a
baz a
dummy b
while on Solaris:
test
foo a
bar c
baz c
dummy c
test2
foo a
bar c
baz c
dummy b

I still need to check behaviour in presence of multiple filters (if I
understood correctly one DSO can either have DT_FILTER or DT_FILTER tags,
never both), but I think basically that there could be just one r_scope_elem
list created for each DSO using DT_FILTER or DT_AUXILIARY, which would
contain all filters and its dependencies.

Shall I, unless this behaviour difference is desirable, work on a patch?

My plan is basically let _dl_map_object_deps create l_filter_searchlist
as described above instead of prepending it into the scope and
do-lookup* should probably recurse if found_it: label sees
l_filter_searchlist != NULL (and if that one does not find the symbol,
check some l_* flag to see if it has normal or aux filters, for
normal filters just continue searching as if sym was not found and for aux
filters continue as if sym was found).

	Jakub
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dt_filter.tar.bz2
Type: application/x-bzip2
Size: 569 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-hacker/attachments/20010517/3c17c2e5/attachment.bz2>


More information about the Libc-hacker mailing list