Subject: Re: I want all binaries stripped
To: David Laight <david@l8s.co.uk>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 06/09/2005 12:09:59
On Sat, 4 Jun 2005, David Laight wrote:

> On Fri, Jun 03, 2005 at 09:14:43PM -0700, Jeremy C. Reed wrote:
> > Any suggestions on getting all executables and shared libraries to be
> > stripped?
> >
> > So file(1) says "stripped"?
> >
> > For example, notice this huge space savings:
> >
> > montecristo:/usr/pkgsrc/www/curl$ ls -l /usr/lib/libcurl.so.3.0.0
> > -rwxr-xr-x  1 root root 3177005 Jun  4 03:55 /usr/lib/libcurl.so.3.0.0
> >
> > montecristo:/usr/pkgsrc/www/curl$ sudo strip /usr/lib/libcurl.so.3.0.0
> >
> > montecristo:/usr/pkgsrc/www/curl$ ls -l /usr/lib/libcurl.so.3.0.0
> > -rwxr-xr-x  1 root root 230648 Jun  4 04:01 /usr/lib/libcurl.so.3.0.0
>
> Which ELF section are you removing, I can't imagine that is just
> the normal symbol table - which might be 5-10%
>
> Maybe that library has been compiled with -g (hi gnu folks) and you are
> removing all the debugging symbols.

That's what it looks like.

What tool can I use to quickly check all my binaries and libraries to see
what symbols that include?

What should I look for?

I looked at objdump, but don't see yet.

Any quick descriptions of all the different types of un-needed symbols?

And any benchmarks or analysis of performance (startup and running) of
executables and libraries with and without the various symbols (including
debugging)?

Greg Woods mentioned in some posting that some extra symbols didn't make
any difference in the runtime memory usage. But I am looking for more
details and explanation.

By the way, I also now am setting:
MAKE_ENV+=     INSTALL_STRIP_FLAG=${_STRIPFLAG_CC}
which appears to work for several autoconf/automake using packages.

This is not specific to libcurl above, but I have many packages that can
be reduced in over half the size.

 Jeremy C. Reed

 	  	 	 BSD News, BSD tutorials, BSD links
	  	 	 http://www.bsdnewsletter.com/