This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: .weak vs. C++ templates. was: SCO 5.0.2 error


> 
> >>>>> 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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]