[patch libgcc]: Adjust cygming-crtbegin code to use weak

Kai Tietz ktietz70@googlemail.com
Sat Mar 23 00:27:00 GMT 2013


2013/3/23 Dave Korn <dave.korn.cygwin@gmail.com>:
> On 23/03/2013 00:08, Kai Tietz wrote:
>> 2013/3/23 Dave Korn <dave.korn.cygwin@gmail.com>:
>
>>>   Also, can you explain the motivation for this change?  I don't see how it's
>>> going to work right; from what I remember, we don't have weak definitions in
>>> PE-COFF, just weak references.  How does the correct definition get chosen
>>> when we may have two definitions in a final link?
>>
>> Well, weak undefs are possible with pe-coff.  We ran into that by
>> porting cygwin to x64.
>> But you are right that pe-coff doesn't support undefines (weak or
>> none-weak) within final-link, so for a weak we need always a default
>> implementation.  This we added here.
>
>   I thought it does (support weak undefines within final link).  Weak
> references with no definition resolve to zero, no?
>
>     cheers,
>       DaveK
>

No, actual they aren't zero value, they are reported as undefined
symbol, which seems to me from perpective of pe-coff weak definition
the right thing to do.

Cheers,
Kai



More information about the Gcc-patches mailing list