From: Stephen Thomas <scjthm@live.com>
To: "musl@lists.openwall.com" <musl@lists.openwall.com>
Subject: RE: Linking musl with ld.gold
Date: Thu, 8 May 2014 01:03:19 +0100 [thread overview]
Message-ID: <SNT146-W742E2A2A090B1CAA578DD5A8490@phx.gbl> (raw)
In-Reply-To: <20140507130443.72c74f47@vostro>
[-- Attachment #1.1: Type: text/plain, Size: 1118 bytes --]
> > > 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
[-- Attachment #1.2: Type: text/html, Size: 1549 bytes --]
[-- Attachment #2: badgcc.sh --]
[-- Type: application/x-sh, Size: 1133 bytes --]
next prev parent reply other threads:[~2014-05-08 0:03 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-06 9:07 Stephen Thomas
2014-05-06 10:14 ` Szabolcs Nagy
2014-05-06 21:11 ` Stephen Thomas
2014-05-06 23:18 ` Szabolcs Nagy
2014-05-07 9:04 ` Stephen Thomas
2014-05-07 10:04 ` Timo Teras
2014-05-08 0:03 ` Stephen Thomas [this message]
2014-05-08 1:06 ` Rich Felker
2014-05-08 2:08 ` Stephen Thomas
2014-05-08 3:01 ` Rich Felker
2014-05-08 5:11 ` Timo Teras
2014-05-08 5:18 ` Rich Felker
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SNT146-W742E2A2A090B1CAA578DD5A8490@phx.gbl \
--to=scjthm@live.com \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).