From: Szabolcs Nagy <nsz@port70.net>
To: musl@lists.openwall.com
Subject: Re: Linking musl with ld.gold
Date: Tue, 6 May 2014 12:14:10 +0200 [thread overview]
Message-ID: <20140506101410.GP12324@port70.net> (raw)
In-Reply-To: <SNT146-W59B5DCFCFA347D836FB3D9A84F0@phx.gbl>
* Stephen Thomas <scjthm@live.com> [2014-05-06 10:07:59 +0100]:
> I have come across a problem and it only appears when the gold linker is used. I am using the latest release of binutils, binutils-2.24.51.0.3.
> I discovered that busybox was not flushing stdout (as there was no prompt appearing) when using musl. Busybox calls fflush(NULL) which should flush stdout as done in src/stdio/fflush.c.
> In that file I checked the value for __stdout_used and it came back as 0. So I changed the declaration of the weak symbol to an extern FILE* __stdout_used and stdout was being flushed.
> Has anyone else seen this and have they reported this apparent bug in binutils?
i think we only reported a broken tls visibility issue against gold
https://sourceware.org/bugzilla/show_bug.cgi?id=16728
you should try to reproduce the bug on a minimal example, eg. the
following code works here with gold (binutils 2.22)
// a.c
struct foo {int i;};
static struct foo *const dummy = 0;
extern struct foo *const hasfoo __attribute__((weak, alias("dummy")));
int f(void)
{
return hasfoo ? hasfoo->i : 0;
}
// b.c
struct foo {int i;};
static struct foo foo = {42};
struct foo *const hasfoo = &foo;
// main.c
int f(void);
int main()
{
return f();
}
gcc main.o a.o -o t1
gcc main.o a.o b.o -o t2
./t1 returns 0
./t2 returns 42
next prev parent reply other threads:[~2014-05-06 10:14 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 [this message]
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
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=20140506101410.GP12324@port70.net \
--to=nsz@port70.net \
--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).