On Fri Oct 13, 2000 at 09:04:22AM -0700, Pawan Singh wrote:
> Does anyone use any tool which can look at all the executables and shared
> libraries on a linux based embedded system and list all the functions in
> shared libraries which are never used? This can be used to strip out large
> chunks of code segment which will never be used.

Lineo has a tool that does this called lipo.  Debian has a tool that does this
(but does a less then stellar job on several non-x86 platforms) called
mklibs.sh which lives in the boot floppies source tree.  Both build a list of
used shared symbold, take static libraries (.a) compiled as pic, and then build
new shared libraries from the pic libs by throwing away unused symbols.  Some
things cannot be handled by this approach, for example a static symbol analysis
does not catch dlopen'ed libraries.  Similarly, some platforms have some funky
symbols that are used by the dynamic library loader that do not show up via
static analysis.  Lineo's lipo handles this, while the Debian's mklibs.sh needs
some more work in this area.

The Debian boot floppies are able to fit on floppies because of this -- it
makes a huge difference.  The only real problem is that GNU libc was never
intended for embedded systems, and so has a nasty tangle of interdependant
functions that severely limits its ability to be stripped down in this way
(which is also why a statically linked "hello world" app is 200k with glibc).

 -Erik

--
Erik B. Andersen   email:  [EMAIL PROTECTED]
--This message was written using 73% post-consumer electrons--

--
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the command "unsubscribe linux-embedded" in the message body.
For more information, see <http://waste.org/mail/linux-embedded>.

Reply via email to