This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: objcopy --strip-symbol
- From: Tristan Gingold <gingold at adacore dot com>
- To: EXTERNAL Setzer Sebastian (ESE; CM-IS/ESW4) <external dot Sebastian dot Setzer at de dot bosch dot com>
- Cc: "binutils at sourceware dot org" <binutils at sourceware dot org>
- Date: Tue, 7 Jul 2009 11:29:07 +0200
- Subject: Re: objcopy --strip-symbol
- References: <D1532AEEE922774789898C5FFDC489440F361B5522@SI-MBX16.de.bosch.com>
On Jul 7, 2009, at 11:23 AM, EXTERNAL Setzer Sebastian (ESE; CM-IS/
ESW4) wrote:
Hello,
Lets assume I've got an object file with function foo, which calls
bar (which is not part of the object file) and some other functions
which don't call bar.
After "--strip-symbol foo", bar is not needed anymore.
Well, this might be not true. There might be a function within the
object file that calls foo.
Is there a way to remove referenced symbols (like bar), which are
not needed anymore because the referencing function isn't there
anymore?
The referencing function is still there, only its symbol has been
removed.
I can use "--strip-symbol bar", but that's dangerous - if there is
still a function calling bar, i get a runtime error, but no warning
at compile time.
IMHO you're playing a dangerous game. Can you explain the problem you
want to solve ? You'd better
to put foo in a separate object file or you can use -ffunction-sections.
Tristan.