|
Message-ID: <20140506101410.GP12324@port70.net> Date: Tue, 6 May 2014 12:14:10 +0200 From: Szabolcs Nagy <nsz@...t70.net> To: musl@...ts.openwall.com Subject: Re: Linking musl with ld.gold * Stephen Thomas <scjthm@...e.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
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.