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/10/2004 13:48:00
[ On Friday, December 10, 2004 at 10:33:50 (+0100), Igor Sobrado wrote: ]
> Subject: Re: bin/28590: binaries in NetBSD 2.0 should be stripped
>
> As I explained in a previous email (don't know if this email has
> arrived to the right mailing lists) I was not aware that ONLY symbol
> tables information was added to the binaries.  As this information
> was not available in earlier NetBSD releases I supposed that both
> symbol tables information and debuggin information (source code)
> was provided in the binaries, as a consequence of a flag not added
> (-s) to the linker when building the production binaries.  I did
> not run gdb(1) on any binary to check this issue.

No problem!

> I am not the only NetBSD user that supposed that it was a mistake
> in the building process, as this change was NOT clearly documented.

No doubt you are correct.

It has been a change I've been eagerly anticipating for a long time
now, so I've forgotten that it may be a small surprise to some folks.


Note that the difference between the normal symbol table information and
the full debugging tables provided when things are compiled with '-g' is
quite significant (though the objects still don't include the actual
source code -- just pointers to the files and the line numbers in them).

Let me assure you that if the binaries contained full '-g' info then
you'd probably be well aware of it!  For example a static-linked "sh" on
the alpha platform has the following different file sizes with and
without the '-g' information:

$ ls -l NetBSD-1.6.x-alpha-destdir*/bin/sh
-r-xr-xr-x  1 woods  wheel   605639 Nov 22 20:19 NetBSD-1.6.x-alpha-destdir-no-g/bin/sh
-r-xr-xr-x  1 woods  wheel  2171367 Nov 22 20:19 NetBSD-1.6.x-alpha-destdir/bin/sh

However even then the resources needed to load and start running the
programs are the same:

$ size NetBSD-1.6.x-alpha-destdir*/bin/sh  
text    data    bss     dec     hex     filename
499946  18072   21604   539622  83be6   NetBSD-1.6.x-alpha-destdir-no-g/bin/sh
499946  18072   21604   539622  83be6   NetBSD-1.6.x-alpha-destdir/bin/sh

So in the end if you've got _lots_ of spare disk space then there's no
real harm (performance-wise) in having all that extra information handy
-- it certainly does make debugging core files even easier.  :-)

(it does make installs and upgrades a bit slower though -- and e.g. for
the alpha a full static-linked release with '-g' info won't fit on a
single CD-ROM :-)

-- 
						Greg A. Woods

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