This is the mail archive of the
mailing list for the binutils project.
Re: [RFC PATCH] Don't put local or undefined symbols into .hash
- From: Daniel Jacobowitz <drow at false dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Mon, 26 Jun 2006 09:02:11 -0400
- Subject: Re: [RFC PATCH] Don't put local or undefined symbols into .hash
- References: <20060626123238.GU3823@sunsite.mff.cuni.cz>
On Mon, Jun 26, 2006 at 02:32:38PM +0200, Jakub Jelinek wrote:
> 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.