Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 8 Aug 2012 08:49:54 -0400
From: Rich Felker <>
Subject: Re: ldso : dladdr support

On Wed, Aug 08, 2012 at 11:55:45AM +0200, musl wrote:
> > Also, we had a conversation on the list and/or IRC a while back (I
> > don't remember which) where I described some optimizations that should
> > be present if gnu hash is to be supported. Basically, the dynamic
> > linker should keep track of whether there's one of the two hashes
> > that's supported by ALL loaded libs, and in that case, only ever use
> > that hash, to avoid computing two different hashes.
> The hash for given algo is only computed once (if needed).
> That's the reason for the computed table.
> If all libs uses the same hash algo, the other will never be computed.

All libs can have both algos (and MUST, if they use gnu hash at all,
in order to be conformant; the only reason this code is needed is to
support non-conformant lib files that lack standard ELF (sysv) hash).
The case I'm talking about is where 10 libs are loaded, and 9 of them
have both hashes but the last only has sysv. In that case, sysv should
get used and gnu should never get computed, or at least that was my

> I added the precomp table wich includes both gnu and sysv hashes for the dlopen,
> dlsym and __stack_chk_fail symbols.

Indeed, that seems to be correct now.

I'll give the patch a better review soon.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.