This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: .weak vs. C++ templates. was: SCO 5.0.2 error
- To: jason at cygnus dot com (Jason Merrill)
- Subject: Re: .weak vs. C++ templates. was: SCO 5.0.2 error
- From: hjl at lucon dot org (H.J. Lu)
- Date: Fri, 22 Oct 1999 13:59:07 -0700 (PDT)
- Cc: robertlipe at usa dot net (Robert Lipe),wrobbie at my-Deja dot com (Rob Kramer), egcs at egcs dot cygnus dot com,jason at cygnus dot com
>
> >>>>> Robert Lipe <robertlipe@usa.net> writes:
>
> > What do we give up by turning off weak support in a target?
>
> Implicit instantiation of static data member templates, mainly; other than
> that, it's just that you get multiple copies of things in violation of the
> standard, but most programs don't care.
>
> I've come to the conclusion that the right fix for this situation is to
> always make template instantiations weak, whether implicit or explicit.
> Sound reasonable?
>
I think I tried it before while working on a g++ related bug and it
didn't work too well with GNU/ld. We wound up fixing GNU/ld instead.
Here is the related ChangeLog entry in bfd:
1999-07-07 Ian Lance Taylor <ian@zembu.com>
Based on patch from H.J. Lu <hjl@gnu.org>:
* elflink.h (elf_merge_symbol): Permit a non-weak definition in a
shared library to override a weak definition in a regular object.
However, I didn't remember if I kept the testcase.
--
H.J. Lu (hjl@gnu.org)