-fzero-initialized-in-bss

Michael LeBlanc leblanc@skycomputers.com
Thu May 6 11:45:00 GMT 2004


We're having some obscure failures with code containing things like

	static struct something *ptr = 0;

The variable ptr is placed in .bss (.sbss with -Os) and allocated via 
.zero.  Running the program under gdb shows the value as -1.  If I 
recompile with -fno-zero-initialized-in-bss, it goes to .data, the 
value appears as 0, and the program runs as expected.

I apologize in advance if this issue has already been addressed.  I 
have not crawled through all the archives.  Our compiler configuration 
is shown below.  Our platform is a PowerPC 745x running Yellow Dog 
Linux 3.0.  Thanks.

Mike LeBlanc
SKY Computers, Inc.

gcc -v
Reading specs from /usr/mike/lib/gcc-lib/ppc-sky-linux/3.3/specs
Configured with: ../gnu-tool-chain/gcc/configure --with-cpu=7450 
--enable-altivec
	--enable-shared --enable-threads=posix --enable-languages=c,c++ 
--disable-checking
	--with-system-zlib --enable-__cxa_atexit --host=ppc-sky-linux 
--target=ppc-sky-linux
	--prefix=/usr/mike : (reconfigured)
Thread model: posix
gcc version 3.3



More information about the Gcc mailing list