Date: Thu, 23 Aug 2012 18:21:13 -0400 From: Rich Felker <dalias@...ifal.cx> To: musl@...ts.openwall.com Subject: Re: ldso : dladdr support 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. Rich View attachment "gnuhash.diff" of type "text/plain" (5092 bytes)
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.