This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC PATCH] Don't put local or undefined symbols into .hash


On Mon, Jun 26, 2006 at 02:32:38PM +0200, Jakub Jelinek wrote:
> Hi!
> 
> It seems an average shared library has roughly 25% of undefined symbols
> in its .dynsym section.
> Currently, the linker puts all dynamic symbols (except the special ones like
> section symbols or symbol 0) into the .hash section, but the dynamic linker
> will always skip STB_LOCAL symbols or undefined symbols (except those with
> st_value != 0) - it is always looking for symbol definitions.
> Is there any reason why we put even the undefined or local symbols into
> .hash?  It just makes the .hash buckets array larger and/or the hash chains
> longer than necessary.
> Or is there something that relies on all symbols being there?
> So far I have noticed just readelf -Ds (but in that case it is questionable
> if readelf -Ds would need to change or stay as is).

Regardless of whether any other software would break, please don't let
readelf -Ds just ignore the undefined symbols.  If you want to leave
them out of the hash table, maybe readelf -Ds should make a second pass
to dump out things from .dynsym which weren't in the hash.

I often use this to work out a library's dependencies.


-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]