This is the mail archive of the 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]

AW: objcopy --strip-symbol

> Von: Tristan Gingold []
> Gesendet: Dienstag, 7. Juli 2009 11:29
> An: EXTERNAL Setzer Sebastian (ESE; CM-IS/ESW4)
> Cc:
> Betreff: 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.
> > 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.
Thanks, that explains a lot. So to remove foo completely, I've got to use -ffunction-sections and --remove-section?

> IMHO you're playing a dangerous game.  Can you explain the
> problem you want to solve ?
I want to replace foo with my own version without touching the original source.
I already tried --wrap when linking, but this doesn't help with the undefined reference to bar, of course.

> 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]