gcc iussue or ... ?

Luigi Rizzo rizzo at icir.org
Fri Apr 11 11:19:47 PDT 2003


On Fri, Apr 11, 2003 at 10:07:38AM -0400, Leo Bicknell wrote:
> In a message written on Fri, Apr 11, 2003 at 08:41:37AM +0200, Gianmarco Giovannelli wrote:
> > The problem is that if I compile it under FreeBSD it is a binary of 19M, 
> > while on linux (debian 3.0), same Makefile, is only 2MB. FreeBSD 5.0 and 
> > OpenBSD 3.1 produce the (about) 19M file.
> 
> Well, the problem location is fairly obvious:
> 
> % ls -lags | sort -nr | more
> 19416 -rwxr-xr-x  1 bicknell  wheel  19854956 Apr 11 09:49 lonewolf*
> 16912 -rw-r--r--  1 bicknell  wheel  17286792 Apr 11 09:42 globals.o
...
> may be making them bigger than you expected.  It could also be that
> FreeBSD puts some types of globals in the executable to load, where as

which was exactly the question -- the same exact source code,
compiled with the same compiler flags (and i think even the
same compiler), produces the two different results.
My suspect was that somehow some of the compiler's header files
on FreeBSD explicitly initializes (to 0) some member of some class
thus resulting in having them in the .data section instead of .bss

	cheers
	luigi
 


More information about the freebsd-hackers mailing list