tech-userlevel archive

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

Trivial program size inflation



Based on something at work, I was looking at executable sizes.  I
eventually tried a program stripped about as far down as I could:

int main(void);
int main(void)
{
 return(0);
}

and built it -static.  size on the resulting binary:

sparc, my mutant 1.4T:

text    data    bss     dec     hex     filename
12616   124     288     13028   32e4    main

amd64, my mutant 5.2:

   text	   data	    bss	    dec	    hex	filename
 152613	   4416	  16792	 173821	  2a6fd	main

amd64, 9.0_STABLE (ftp.n.o):

   text    data     bss     dec     hex filename
 562318   29064 2176416 2767798  2a3bb6 main

12K to do nothing is bad enough (I'm going to be looking at why it's
that big).  149K is even more disturbing (I'll be looking at that too).
But over half a meg of text and two megs of BSS?  To do nothing?
Surely something is wrong somewhere.

Not that NetBSD is alone in this.  On an Ubuntu machine at work, I see

   text	   data	    bss	    dec	    hex	filename
 761750	  20804	   6016	 788570	  c085a	main

but I hardly think Ubuntu's sins are relevant to NetBSD. :-)

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		mouse%rodents-montreal.org@localhost
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B


Home | Main Index | Thread Index | Old Index