Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SNT146-W742E2A2A090B1CAA578DD5A8490@phx.gbl>
Date: Thu, 8 May 2014 01:03:19 +0100
From: Stephen Thomas <scjthm@...e.com>
To: "musl@...ts.openwall.com" <musl@...ts.openwall.com>
Subject: RE: Linking musl with ld.gold



> > > 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  
> > 
> > Ok, thanks for that info. It appears that there is a problem in gcc
> > 4.9 and not 4.8.3.
> 
> Is perhaps -ffunction-sections and/or -fdata-sections added
> automatically? Those would break musl like experienced.

Thanks for that tip, but I didn't change the sections in the linker script. I didn't add any flags either. I attach the single test case cleaned up a bit. I ran this on the buildroot toolchain (standard config with uclibc and with 2.24.0 binutils) with 4.8.2 and the result is 42. I rebuilt the toolchain only changing the compiler version to 4.9.2 and the result is 0.
This corroborates what I was seeing (or not as in the case of the prompt not appearing in busybox) with my builds also.
Thomo 		 	   		  
Content of type "text/html" skipped

Download attachment "badgcc.sh" of type "application/x-sh" (1133 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.