Defined symbols requiring an other library.

Kurt Roeckx kurt@roeckx.be
Mon Jan 7 18:27:00 GMT 2008


Hi,

In Debian we recently started to track all the symbols that a library
provides.  This comes down to listing all the defined symbols
in a library, except some special cases.

When we link some other binary we look at the undefined symbols it has
and then look which from the libraries it has a DT_NEEDED entry for
provides those symbols.  We use this to see what the minumum version
requirement of that library we should use.

We found a problem with this method.  If there is a copy relocation
for the symbol it ends up as a defined symbol in the .bss, while the
real symbol is actually in an other library.  So it needs that library
but we currently don't see it.

Mips and mipsel seem to be the only arches in Debian that do not have
copy relocations, and those symbols end up as undefined there as
expected.

So we now plan to change it so that defined symbols that also have a
copy relocation are threated as undefined symbols.  

Does anybody know if there will be other things that might be a problem
we have doing this?  Or is there a better of doing this?

We basicly need a list of symbols that a library provides and a list of
symbols that are provided by an other library.


Kurt



More information about the Binutils mailing list