2013/3/23 Dave Korn <dave.korn.cyg...@gmail.com>: > On 22/03/2013 08:44, Kai Tietz wrote: >> Hi, >> >> this change is actual used by cygwin and is required for upcoming x64 >> cygwin target. >> >> ChangeLog >> >> 2013-03-22 Kai Tietz <kti...@redhat.com> >> >> * config/i386/cygming-crtbegin.c (__register_frame_info): Make weak. >> (__deregister_frame_info): Likewise. >> >> Tested for i686-pc-cygwin, and x86_64-pc-cygwin. I will apply this >> code tomorrow if there are no objections by other >> Windows-target-maintainers. > > > I don't think the ChangeLog entry is right; it doesn't make the declarations > weak, it supplies definitions. > > 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. If in a different TU a none-weak implementation is present, ld will resolve that as usual. > cheers, > DaveK Cheers, Kai