This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: RFC: Add STB_GNU_SECONDARY
"H.J. Lu" <hjl.tools@gmail.com> writes:
> On Fri, Apr 20, 2012 at 5:49 PM, Ian Lance Taylor <iant@google.com> wrote:
>> "H.J. Lu" <hjl.tools@gmail.com> writes:
>>
>>> In our usage, the backup definition may not be at the end of
>>> command line since it may reference library symbols.
>>
>> You could write out the backup function you need under a different name.
>> Then have the backup symbol at the end of the link call the new name of
>> the backup function.
>
> isn't it replacing one backup with another backup?
Let's say your symbol is f. I'm proposing that in the object file you
write out
void
f_implementation ()
{
/* Whatever you want. */
/* Call library functions, etc. */
}
Then in an object at the end of the link, put
void
f () __attribute__ ((weak))
{
f_implementation ();
}
Ian