From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7793 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: Question re: dynamic linking in musl Date: Wed, 27 May 2015 10:06:58 -0400 Message-ID: <20150527140658.GK17573@brightrain.aerifal.cx> References: <20150527100844.GA306@alex-ThinkPad-L530> <5565A812.9090004@gmail.com> <20150527160955.1bda26cf@vostro> <5565C357.1070508@gmail.com> <20150527162326.15405862@vostro> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1432735634 1936 80.91.229.3 (27 May 2015 14:07:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 27 May 2015 14:07:14 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7805-gllmg-musl=m.gmane.org@lists.openwall.com Wed May 27 16:07:13 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YxbzF-0005Ih-8m for gllmg-musl@m.gmane.org; Wed, 27 May 2015 16:07:13 +0200 Original-Received: (qmail 28413 invoked by uid 550); 27 May 2015 14:07:11 -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 28391 invoked from network); 27 May 2015 14:07:10 -0000 Content-Disposition: inline In-Reply-To: <20150527162326.15405862@vostro> User-Agent: Mutt/1.5.21 (2010-09-15) Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:7793 Archived-At: On Wed, May 27, 2015 at 04:23:26PM +0300, Timo Teras wrote: > On Wed, 27 May 2015 15:15:03 +0200 > Alex Dowad wrote: > > > On 27/05/15 15:09, Timo Teras wrote: > > > On Wed, 27 May 2015 16:01:50 +0300 (MSK) > > > Alexander Monakov wrote: > > > > > >> I'm not familiar with Alpine. Hopefully someone else can chime in > > >> whether .gnu.hash is deliberately disabled. > > > We have not touched, so we are using the gcc default. Which > > > apparently then is sysv only (bummer). > > > > Yes, that callgrind profile was from a program installed from Alpine > > repos. > > > > Use --hash-style=both in LD_FLAGS when building the APKs, and dynamic > > linking will become much faster! > > We want that in the toolchain. It's gcc configure option: > --with-linker-hash-style={sysv,gnu,both} > > I wonder if it should be 'gnu' or 'both'. Apparently 'both' will be > larger as then everything is hashed twice. > > Is there any known issues if I just specify 'gnu' ? In the sense of "known issues" I would say no, but I would still strongly discourage this. A valid dynamic ELF file requries the sysv (standard ELF) hash table; the original reason musl added support for GNU hash was for ABI-compat to be able to run binaries from distros that were producing "invalid" ELF files. :-) While musl fully supports either, and will perform considerably better when GNU hash is present once we get Alexander Monakov's improvements in, it's possible that some simple tools for processing ELF files, or programs which do various sorts of introspection via dl_iterate_phdr or otherwise, may expect the sysv hash table to be present and fail badly without it. Rich