RFC: Add STB_GNU_SECONDARY
Fri Apr 20 23:31:00 GMT 2012
On Fri, Apr 20, 2012 at 3:54 PM, Petr Baudis <email@example.com> wrote:
> On Fri, Apr 20, 2012 at 01:11:34PM -0700, H.J. Lu wrote:
>> On Fri, Apr 20, 2012 at 12:50 PM, Roland McGrath <firstname.lastname@example.org> wrote:
>> > Please provide an example that illustrates why you think you need this.
>> Currently we use weak undefined symbol, foo, to do
>> if (&foo != 0)
>> foo is defined.
>> foo isn't defined.
>> We want is to define foo as a secondary symbol so that
>> we can always use foo without checking. If there is a primary
>> one in a .o file and .so file, we will get the primary one,
>> otherwise, we will use the secondary one.
> This is still a very general example. Does this concern a particular
> software package?
We have a compiler optimization feature which requires a backup
definition just in case that the primary one doesn't exist in an archive
or a DSO.
> Couldn't you use IFUNC to perform the if-statement above and supply
> the proper function?
More information about the Binutils