public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* strip/objcopy will not remove dynamic symbols
@ 2004-06-23  1:23 William Croft
  2004-06-23  3:48 ` H. J. Lu
  0 siblings, 1 reply; 2+ messages in thread
From: William Croft @ 2004-06-23  1:23 UTC (permalink / raw)
  To: binutils

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.

I already tried other options that I thought might help:  --strip-unneeded and -L symbolname (localize symbol).  That didnt work either.

Thanks for your ideas.

--Bill Croft

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: strip/objcopy will not remove dynamic symbols
  2004-06-23  1:23 strip/objcopy will not remove dynamic symbols William Croft
@ 2004-06-23  3:48 ` H. J. Lu
  0 siblings, 0 replies; 2+ messages in thread
From: H. J. Lu @ 2004-06-23  3:48 UTC (permalink / raw)
  To: William Croft; +Cc: binutils

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.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-06-23  3:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-23  1:23 strip/objcopy will not remove dynamic symbols William Croft
2004-06-23  3:48 ` H. J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).