From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1761 Path: news.gmane.org!not-for-mail From: musl Newsgroups: gmane.linux.lib.musl.general Subject: Re: ldso : dladdr support Date: Sat, 25 Aug 2012 23:34:13 +0200 Message-ID: <503944D5.1030300@gmail.com> References: <20120808115202.GL30810@port70.net> <5022703B.3090105@gmail.com> <20120811230536.GQ27715@brightrain.aerifal.cx> <20120817053934.GS27715@brightrain.aerifal.cx> <50311776.9040802@gmail.com> <20120820020626.GD27715@brightrain.aerifal.cx> <503233A8.8000604@gmail.com> <50324A60.7040206@gmail.com> <20120823213937.GS27715@brightrain.aerifal.cx> <20120823222113.GT27715@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1345930474 26508 80.91.229.3 (25 Aug 2012 21:34:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Aug 2012 21:34:34 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1762-gllmg-musl=m.gmane.org@lists.openwall.com Sat Aug 25 23:34:35 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1T5O00-0004a5-Dv for gllmg-musl@plane.gmane.org; Sat, 25 Aug 2012 23:34:32 +0200 Original-Received: (qmail 31766 invoked by uid 550); 25 Aug 2012 21:34:29 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 31758 invoked from network); 25 Aug 2012 21:34:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=V+WuzMHHObYoWHTfTbXxj9ei+2ytVf13dxYUf5/FrF0=; b=bHCnVkTbMI5FJahVKgz5n5kBOgMz2zUJ2R4qngghMn0tmXOM1dcfeX4bJo5JmdAU5p 5mHkidXvL9ThHEsC5skc3EM05NNQVIltzWFewyqjeJkNhsyJ8k2FrPUak9wM7qNy680g yf3gYKAPluIuGZjujF8xyrcZOsAyitWa4jtKALgp1pDcnoONa1AVt8NRMURP+/hkuuCh XCgFvzmP+geCYuxiIpp/d4mQCv0kTR30JAsNOTokJc8rqpyCiFzfV5YaB8RGTCVeHkNP L//eK5rya34r5bRf00e0emsNak/7pWAA8MhwsSeMkBk201vPXsBBtHdq1fNR8V+qHoMT u4zw== User-Agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0 In-Reply-To: <20120823222113.GT27715@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:1761 Archived-At: 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