From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2775 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 2/3] Have different definitions of __pthread_tsd_main agree in size Date: Mon, 11 Feb 2013 13:08:16 +0100 Message-ID: <20130211120816.GC6181@port70.net> References: <1360535367.23424.466.camel@eris.loria.fr> <20130211003158.GP20323@brightrain.aerifal.cx> <1360568420.23424.521.camel@eris.loria.fr> <20130211112237.GB6181@port70.net> 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 1360584508 30942 80.91.229.3 (11 Feb 2013 12:08:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Feb 2013 12:08:28 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2776-gllmg-musl=m.gmane.org@lists.openwall.com Mon Feb 11 13:08:49 2013 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 1U4sBj-0000lY-Ik for gllmg-musl@plane.gmane.org; Mon, 11 Feb 2013 13:08:47 +0100 Original-Received: (qmail 31842 invoked by uid 550); 11 Feb 2013 12:08:28 -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 31834 invoked from network); 11 Feb 2013 12:08:28 -0000 Content-Disposition: inline In-Reply-To: <20130211112237.GB6181@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2775 Archived-At: * Szabolcs Nagy [2013-02-11 12:22:37 +0100]: > * Jens Gustedt [2013-02-11 08:40:20 +0100]: > > In any case, this is perhaps better done with the tool chain. I have > > good experience by having > > > > -fdata-sections -ffunction-sections > > > > for the compiler options and then > > > > -Wl, --gc-sections > > > > for the link. In the case of musl, this removes exactly all the dummy > > sections :) plus two others (pad and sccp), see below. > > > > are you sure about the correctness of these? > > they seem to be broken to me: weak aliases are not respected > and functions are dropped even if there are weak references to > them which is bad.. > > eg if sccp is dropped then in any code that does not > use pthread, the cancellable syscalls will be broken > (if i understand these right) ah sorry, --gc-sections is for dynamic linking, there the weak aliases dont matter and in case of static linking -fdata-sections and -ffunction-sections just makes the elfheader bigger and the linking slower (sum size of sections may be a bit smaller or bigger because of alignment things) so these flags may be useful for building .so