This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/11854] New: -fdata-sections put everything into the data section not BSS
- From: "andrew dot lunn at ascom dot ch" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Aug 2003 13:36:51 -0000
- Subject: [Bug c/11854] New: -fdata-sections put everything into the data section not BSS
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11854
Summary: -fdata-sections put everything into the data section not
BSS
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: andrew dot lunn at ascom dot ch
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: mips64vr-unknown-elf
~$ cat bss.c
int foo;
static int bar;
int fred=1;
~$ /opt/ecos/gnutools/mips64vr-elf-3.3.1/bin/mips64vr-elf-gcc -save-temps -o
bss.o -c bss.c -fdata-sections
~$ cat bss.s
.file 1 "bss.c"
.section .mdebug.abiO64
.previous
.globl fred
.section .sdata.fred,"aw",@progbits
.align 2
.type fred, @object
.size fred, 4
fred:
.word 1
.globl foo
.section .data.foo,"aw",@progbits
.align 2
.type foo, @object
.size foo, 4
foo:
.space 4
.section .data.bar,"aw",@progbits
.align 2
.type bar, @object
.size bar, 4
bar:
.space 4
foo and bar should be in the bss, but with -fdata-section they end up in the
data section making the executable binary huge and mostly 0's