From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/14563 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH] make relocation time symbol lookup and dlsym consistent Date: Mon, 12 Aug 2019 18:26:38 -0400 Message-ID: <20190812222638.GZ9017@brightrain.aerifal.cx> References: <20190810231811.GK22009@port70.net> Reply-To: musl@lists.openwall.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="192575"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-14579-gllmg-musl=m.gmane.org@lists.openwall.com Tue Aug 13 00:26:58 2019 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1hxImH-000nzX-Tg for gllmg-musl@m.gmane.org; Tue, 13 Aug 2019 00:26:58 +0200 Original-Received: (qmail 5857 invoked by uid 550); 12 Aug 2019 22:26:51 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 5837 invoked from network); 12 Aug 2019 22:26:50 -0000 Content-Disposition: inline In-Reply-To: <20190810231811.GK22009@port70.net> Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:14563 Archived-At: On Sun, Aug 11, 2019 at 01:18:11AM +0200, Szabolcs Nagy wrote: > rebased the old patch. > > changed a bit to avoid performance concerns. > >From a57cd35acf26ba6202ed6534a57f496464f431a1 Mon Sep 17 00:00:00 2001 > From: Szabolcs Nagy > Date: Sat, 10 Aug 2019 23:14:40 +0000 > Subject: [PATCH] make relocation time symbol lookup and dlsym consistent > > Using common code path for all symbol lookups fixes three dlsym issues: > > - st_shndx of STT_TLS symbols were not checked and thus an undefined > tls symbol reference could be incorrectly treated as a definition > (the sysv hash lookup returns undefined symbols, gnu does not, so should > be rare in practice). > > - symbol binding was not checked so a hidden symbol may be returned > (in principle STB_LOCAL symbols may appear in the dynamic symbol table > for hidden symbols, but linkers most likely don't produce it). > > - mips specific behaviour was not applied (ARCH_SYM_REJECT_UND) so > undefined symbols may be returned on mips. > > always_inline is used to avoid relocation performance regression, the > code generation for find_sym should not be affected. > --- > ldso/dynlink.c | 84 +++++++++++++++++++------------------------------- > 1 file changed, 31 insertions(+), 53 deletions(-) Thanks for rebasing this! Applying. Rich