From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/5066 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Linking musl with ld.gold Date: Wed, 7 May 2014 01:18:08 +0200 Message-ID: <20140506231807.GQ12324@port70.net> References: <20140506101410.GP12324@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 1399418309 28790 80.91.229.3 (6 May 2014 23:18:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 6 May 2014 23:18:29 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-5072-gllmg-musl=m.gmane.org@lists.openwall.com Wed May 07 01:18:22 2014 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 1Whocv-0005YX-3t for gllmg-musl@plane.gmane.org; Wed, 07 May 2014 01:18:21 +0200 Original-Received: (qmail 7245 invoked by uid 550); 6 May 2014 23:18:20 -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 7235 invoked from network); 6 May 2014 23:18:19 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:5066 Archived-At: * Stephen Thomas [2014-05-06 22:11:32 +0100]: > I think that I have managed to reproduce the problem, in as much isolation as possible. I believe that there is a missing step in your test, which is included in the build, and that is the creation of the archive. I may have done something incorrect also, which is also very likely. > I attach a simple script for running the tests on my machine. Unfortunately, the system I use doesn't display indicate where ld.gold was being used as it chooses to do this by changing the symlink to which ld points to. > To summari(s/z)e when using ar to create an archive the weak symbol doesn't appear to be overridden, using either ld.bfd nor ld.gold. The script that was used to generate the output is attached and this should describe the 4 test cases. Test case #2 is probably irrelevant, and the first two are simply reproducing the results of your tests. only the object files with referenced symbols are linked from an archive so only a.o with the given main.o because of the symbol f now if you make some reference in main.c such that b.o should be included but main still returns 0 that would be a bug eg. add a void g(void){} to b.c and call it from main.c