Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 25 Aug 2012 23:34:13 +0200
From: musl <>
Subject: Re: ldso : dladdr support

On 24/08/2012 00:21, Rich Felker wrote:
> On Thu, Aug 23, 2012 at 05:39:37PM -0400, Rich Felker wrote:
>> On Mon, Aug 20, 2012 at 04:32:00PM +0200, musl wrote:
>>> I missed a bug in my previous patch :
>>> in find_sym func precomptab was always set to sysv_precomp.
>> It's still broken; h is being used in the comparisons even if h was
>> not initialized, rather than using gh. I'm working on integrating the
>> code right now. I'll either commit my version or reply with a patch
>> here soon for review.
> Here's my proposed patch for gnu hash support. I've left dladdr to be
> committed separately. I handled the precomputed hashes by duplicating
> the code in the two branches; this is _ugly_ but it's moderately
> faster, and I really don't like the performance impact of these checks
> to begin with, so I'd rather not make them even worse.
> Some other changes I've made since Boris's last version:
> - Prefer GNU hash if it's available. It's a lot faster even in single
>   runs, and should make even more difference when data-locality issues
>   come into play (resolving whole files rather than just a single
>   dlsym call).
> - Omit bloom filter checks. It's not clear if they're beneficial on
>   average in large programs, but for single lookups where the symbol
>   is present, they increase lookup time by about 8%.
> - Replace the over-complicated decode_vec2 with search_vec, since we
>   only need a single extended entry anyway. In any case, the big-O
>   performance of high-entry lookups will always be the same as this
>   linear search unless we use heavy data structures, so we might as
>   well just do it this super-simple way.
> Comments welcome. I'll hold off on committing for a while in case I
> made any dumb mistakes.
I found a bug in gnu_lookup of dependencies :

+        if (p->deps[i]->ghashtab) {
+            if (!gh) gh = gnu_hash(s);
+            sym = gnu_lookup(s, h, p->deps[i]);
+        } else {
+            if (!h) h = sysv_hash(s);
+            sym = sysv_lookup(s, h, p->deps[i]);
+        }

you pass 'h' instead of 'gh' to gnu_lookup func
> Rich

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.