[uClibc] Stripping unneeded symbols from shared library

Aurelien Jacobs aurel at gnuage.org
Sat Dec 18 13:19:09 UTC 2004


On Wed, 15 Dec 2004 11:09:36 +0100
uclibc at zevv.nl wrote:

> I'm trying to minimalize my root filesystem size, so I would like to
> omit all functions/symbols from my uClibc shared library that are not
> used by any of the applications or other libs. With some shell
> scripting, nm and objdump, it's not too hard to collect a list of
> symbols that could be removed from libuClibc.so without breaking
> things (I hope).
> 
> How can I remove those syms from an existing .so file ? objcopy and
> strip don't seem to work on shared libs, only on the original .o's,
> but I'd like to perform this action on the finished root fs, without
> the need of recompiling. Any tips would be appreciated.

We are doing the same thing in the geexbox project. We didn't found
a way to remove unused symbols directly from a .so. So what we
did is to compil libs as .a as well and at the end we create a
new .so from this .a only keeping the useful symbols.
Here is the script we are using to do this :
http://geexbox.org/archzoom/devel@geexbox.org--2004/geexbox--main--1--patch-449/scripts/libstrip

Aurel



More information about the uClibc mailing list