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: objcopy --strip-symbol



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.


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