Subject: Re: bin/28590: binaries in NetBSD 2.0 should be stripped
To: Igor Sobrado <igor@string1.ciencias.uniovi.es>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 12/11/2004 04:00:26
[ On Friday, December 10, 2004 at 21:39:23 (+0100), Igor Sobrado wrote: ]
> Subject: Re: bin/28590: binaries in NetBSD 2.0 should be stripped
>
> In other words, there is a little overhead when the binary is loaded
> in the computer memory but it does not require more resources to run!

Well, actually the symbol table(s) never get loaded into RAM at all.

> I never run size(1) on binaries build with and without '-g'.  I am
> surprised to see that all section sizes are the same!

Size doesn't show you the sizes of the debugging section or the or
symbol table.  :-)

The object code, and of course the read-only data, etc., is all
identical regardless of whether '-g' was used or not (at least on
NetBSD).

The size(1) numbers are the same after stripping the symbol table too.

"objdump -h" will show you all the section headers and section sizes,
etc. of all sections (or at least all "public" sections) with ".mdebug"
being the '-g' debugging info.

If I remember right the symbol table isn't a separate section though, so
you don't get to see how big it is.  You can figure it out either by
stripping a copy of the file with strip(1), or you can deduce it by
reading the output of nm(1) or from the 'SYMBOL TABLE" section of the
output from "objdump -x".  

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>