From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2810 Path: news.gmane.org!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH v3 3/3] internally use the symbol __environ instead of environ Date: Sun, 17 Feb 2013 14:31:57 -0500 Message-ID: <20130217193157.GI20323@brightrain.aerifal.cx> References: <1360623064.2536.66.camel@eris.loria.fr> 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 1361129530 12309 80.91.229.3 (17 Feb 2013 19:32:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 17 Feb 2013 19:32:10 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-2811-gllmg-musl=m.gmane.org@lists.openwall.com Sun Feb 17 20:32:32 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 1U79yP-0004Yw-N2 for gllmg-musl@plane.gmane.org; Sun, 17 Feb 2013 20:32:29 +0100 Original-Received: (qmail 30211 invoked by uid 550); 17 Feb 2013 19:32:09 -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 30203 invoked from network); 17 Feb 2013 19:32:09 -0000 Content-Disposition: inline In-Reply-To: <1360623064.2536.66.camel@eris.loria.fr> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:2810 Archived-At: On Mon, Feb 11, 2013 at 11:51:52PM +0100, Jens Gustedt wrote: > When switching optimization to higher levels (-O3) and enable link time > optimization (-flto) my linker explodes because "__environ" is accessed > through an alias named "environ", and that text segment has already been > removed: > > `environ' referenced in section `.text.execvp' of /tmp/cckGfCaK.ltrans1.ltrans.o: defined in discarded section `.text' of src/env/__environ.lo (symbol from plugin) > /usr/bin/ld: BFD (GNU Binutils for Ubuntu) 2.22 assertion fail ../../bfd/elf64-x86-64.c:4365 > > Use the "real" name of __environ directly and make this code consistent > with other functions (such as execv) that already use __environ, > too. > > Some places where "environ" is used may already have been silently > renamed through a macro in internal/libc.h, but it is probably better to > have that in the open. Committed. I believe the fix is complete, since the following no longer turns up any references: $ grep -r [^_]environ src src/process/execve.c: /* do we need to use environ if envp is null? */ src/ldso/dynlink.c: /* Find aux vector just past environ[] */ src/thread/powerpc/syscall_cp.s:#r31: local or environment pointer src/env/__environ.c:weak_alias(__environ, environ); Thanks. Rich