RFC: Add STB_GNU_SECONDARY

H.J. Lu hjl.tools@gmail.com
Fri Apr 20 20:56:00 GMT 2012


On Fri, Apr 20, 2012 at 1:26 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> Currently we use weak undefined symbol, foo, to do
>>
>> if (&foo != 0)
>>  foo is defined.
>> else
>>  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.
>
> Why not use a weak definition in the file where you make the call?

It doesn't work for us since a weak definition can't be overridden
by another definition in a .so file.

-- 
H.J.



More information about the Binutils mailing list