This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: strip vs. nm vs. readelf
- From: Daniel Jacobowitz <drow at false dot org>
- To: Erik Leunissen <e dot leunissen at hccnet dot nl>
- Cc: binutils at sourceware dot org
- Date: Wed, 14 Dec 2005 16:35:15 -0500
- Subject: Re: strip vs. nm vs. readelf
- References: <43A08D7B.7060304@hccnet.nl>
On Wed, Dec 14, 2005 at 10:24:11PM +0100, Erik Leunissen wrote:
> L.S.
>
> I stumble across some apparent contradictory behaviour of the
> applications strip, nm and readelf.
>
> This occurs when processing a shared lib "myLib.so" which has been
> subjected to the strip application as follows:
>
> strip --strip-unneeded myLib.so
--strip-unneeded
Remove all symbols that are not needed for relocation processing.
... but leaves the dynamic symbol table; that is always necessary.
> Next, when I invoke:
>
> nm -a myLib.so
>
> the output is (as expected):
>
> nm: myLib.so: no symbols
Try nm -D myLib.so.
> Finally, when doing:
>
> readelf -a myLib.so
>
> a lot of information is emitted, including the names of symbols that I
> believed to be removed by strip.
See which section it says they're in. They'll be in .dynsym, which is
part of the executable image.
--
Daniel Jacobowitz
CodeSourcery, LLC