On Thu, 2001-11-15 at 10:08, Brooks R. Robinson wrote: > | >| linked code). (Does anyone have benchmark results?) If I remember > | >| correctly, it is debian policy to use '-g' and then strip non-library > | >| binaries. I'm sure I'll get howls for suggesting it, but I think that > | >| the policy should be to not use '-g' in the stable distribution. > | > > | current stable distribution. It would be great if someone could get some > | hard numbers on the space saved and performance improvements of getting > | rid of debugging symbols in the stable dist (and post it to devel). > > Greetings, > I just did this as a test. Let's take the ubiquitous "Hello World" > program. The code: > > > #include <stdio.h> > > int main ( void ) > { > printf( "Hello World\n" ); > return 0; > } > > > If you compile this with 'gcc -Wall test.c -o test_clean', the resulting > binary is 4981 bytes. If you compile it with 'gcc -g -Wall test.c -o > test_debug', the resulting binary is 14181 bytes. That is a 284% larger > size. Or if you invert the fraction, the stripped binary is 35% of the size > of the loaded binary. Another statistic is that the source code is a mere > 82 bytes. Now, I don't suppose that this size comparison is exactly the > same for all generated code, but it is an appreciable difference. >
I built a linux from scratch system a while ago, which talks about debugging symbols and relative sizes of stripped and unstripped binaries. I quote from version 3.0: Before you start wondering whether these debugging symbols really make a big difference, here are some statistics. Use them to draw your own conclusion. * A dynamic Bash binary with debugging symbols: 1.2MB * A dynamic Bash binary without debugging symbols: 478KB * /lib and /usr/lib (glibc and gcc files) with debugging symbols: 87MB * /lib and /usr/lib (glibc and gcc files) without debugging symbols: 16MB http://www.linuxfromscratch.org/view/3.0/ch06-aboutdebug.html -- first impressions are bunk (unknown)