bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/11133] New: Static linking with gc-sections deletes __libc


From: tmsriram at google dot com
Subject: [Bug binutils/11133] New: Static linking with gc-sections deletes __libc_atexit causing problems with stdio buffer flush to file.
Date: 5 Jan 2010 01:23:49 -0000

Here is how to reproduce. Using ld with binutils 2.19.

$ cat hello.cc
#include <stdio.h>
int main()
{
  printf("Hello World\n");
}
$ gcc-4.4.0 hello.cc -static -Wl,--gc-sections
$./a.out > hello.out
$ wc hello.out
0 0 0 hello.out

Using, --print-gc-sections shows that :

ld: removing unused section from '__libc_atexit' in file 'libc.a(genops.o)'
ld: removing unused section from '__libc_freeres_fn' in file
'libc.a(register-atfork.o)'
ld: removing unused section from '__libc_subfreeres' in file
'libc.a(register-atfork.o)'
ld: removing unused section from '__libc_freeres_fn' in file 
'libc.a(dcigettext.o)'
...

Removing __libc_atexit was responsible for this behaviour.

-- 
           Summary: Static linking with gc-sections deletes __libc_atexit
                    causing problems with stdio buffer flush to file.
           Product: binutils
           Version: 2.19
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: tmsriram at google dot com
                CC: bug-binutils at gnu dot org
 GCC build triplet: x86_64
  GCC host triplet: x86_64
GCC target triplet: x86_64


http://sourceware.org/bugzilla/show_bug.cgi?id=11133

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]