[KLUG Programming] strip'ing
Adam Williams
programming@kalamazoolinux.org
Tue, 28 Oct 2003 16:29:29 -0500
> >The "strip" command has some different options:
> > --strip-all to remove all symbols
> > --strip-debug to only remove debugging symbols
> > --strip-unneeded ...
> >If I'm trying to save space on a bunch of binaries, is there any reason
> >NOT to use --strip-all? Is there any chance it could cause problems
> >with program execution?
> I believe you want "strip unneeded"; I'm not up on what symbols may be
> used by all the run-time loaders, especially for dynamic library usse.
> Also, use the -o option so you keep the original executable while testing
> the stripped binary. You can also compare file sizes to see how much room
> you're stripping.
I've read about this before, and think Bob is right. But I also don't
think your going to gain anything much.
[awilliam@estate2 awilliam]$ ls -l /usr/sbin/smbd
-rwxr-xr-x 1 root root 2489908 Sep 30 11:01 /usr/sbin/smbd
[root@estate2 awilliam]# strip --strip-unneeded /usr/sbin/smbd
[root@estate2 awilliam]# ls -l /usr/sbin/smbd
-rwxr-xr-x 1 root root 2489908 Oct 28 16:27 /usr/sbin/smbd
Most build routines these days either build unsymbol'd binaries or strip
after building. You'll see the strip step in lots of SPEC files,
etc... So it's pretty hard to find an unstripped binary.