This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch libgcc]: Adjust cygming-crtbegin code to use weak
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: Dave Korn <dave dot korn dot cygwin at gmail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 23 Mar 2013 01:27:27 +0100
- Subject: Re: [patch libgcc]: Adjust cygming-crtbegin code to use weak
- References: <CAEwic4Y5mMhokud4T-ZtA3GAHeWiQsGXfq=goo-2fj9Qm3GHSA at mail dot gmail dot com> <514CF02C dot 5070707 at gmail dot com> <CAEwic4axt7sKSVpmyqX2YBzdfjxNx956tacVcOE6-f06T5CUAA at mail dot gmail dot com> <514CF60B dot 2020806 at gmail dot com>
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