This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: strip vs. nm vs. readelf


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]