[Top][All Lists]
[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.
- [Bug binutils/11133] New: Static linking with gc-sections deletes __libc_atexit causing problems with stdio buffer flush to file.,
tmsriram at google dot com <=
- [Bug binutils/11133] Static linking with gc-sections deletes __libc_atexit causing problems with stdio buffer flush to file., hjl dot tools at gmail dot com, 2010/01/05
- [Bug binutils/11133] Static linking with gc-sections deletes sections with __start/__stop reference, hjl dot tools at gmail dot com, 2010/01/05
- [Bug binutils/11133] Static linking with gc-sections deletes sections with __start/__stop reference, hjl dot tools at gmail dot com, 2010/01/05
- [Bug binutils/11133] Static linking with gc-sections deletes sections with __start/__stop reference, hjl dot tools at gmail dot com, 2010/01/05
- [Bug binutils/11133] Static linking with gc-sections deletes sections with __start/__stop reference, amodra at gmail dot com, 2010/01/06
- [Bug binutils/11133] Static linking with gc-sections deletes sections with __start/__stop reference, ian at airs dot com, 2010/01/06
- [Bug binutils/11133] gc-sections deletes sections with __start/__stop reference, hjl dot tools at gmail dot com, 2010/01/06
- [Bug binutils/11133] gc-sections deletes sections with __start/__stop reference, vapier at gentoo dot org, 2010/01/07
- [Bug binutils/11133] gc-sections deletes sections with __start/__stop reference, amodra at gmail dot com, 2010/01/07
- [Bug binutils/11133] gc-sections deletes sections with __start/__stop reference, hjl dot tools at gmail dot com, 2010/01/07