This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: strip/objcopy will not remove dynamic symbols
- From: "H. J. Lu" <hjl at lucon dot org>
- To: William Croft <croft at mitem dot com>
- Cc: binutils at sources dot redhat dot com
- Date: Tue, 22 Jun 2004 20:48:34 -0700
- Subject: Re: strip/objcopy will not remove dynamic symbols
- References: <40D8DB7D.5000209@mitem.com>
On Tue, Jun 22, 2004 at 06:23:09PM -0700, William Croft wrote:
> When I use the "-N symbolname" option of strip or objcopy, the symbol IS
> removed from the "normal" symbol table (as shown by "nm -a"). But the
> symbol is NOT removed from the dynamic table ("nm -D").
>
> Can anyone suggest a workaround that will allow me to remove a dynamic
> symbol? Or hint at what might be the area to look at in the source? I'm
> currently running binutils 2.13.90.0.18 from Redhat Linux 9, but could
> build my own patched version of strip.
>
> The symbols I'm trying to remove are in our product shared library (say
> "foo.so") that does some license file checks via calling functions internal
> to foo.so. But the license functions were pulled in from a "bar.a" library
> used in linking foo.so. Hence the license functions in foo.so are marked
> in the nm output as 'T' (internally defined global text symbols). But they
> are not called from outside foo.so, so they can be safely deleted from all
> symbol tables.
If you don't want them in the dynamic symbol table, you should make
them internal to foo.so. You can do it with symbol visibility or
linker script.
H.J.