(C++) followup linkage patch
Jason Merrill
jason@cygnus.com
Thu Mar 25 21:47:00 GMT 1999
This fixes the crash building tinfo2.o on non-ELF targets.
1999-03-25 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (comdat_linkage): Treat vtables like functions.
Index: decl2.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl2.c,v
retrieving revision 1.193
retrieving revision 1.194
diff -c -p -r1.193 -r1.194
*** decl2.c 1999/03/23 02:33:34 1.193
--- decl2.c 1999/03/25 19:45:25 1.194
*************** comdat_linkage (decl)
*** 2370,2379 ****
{
if (flag_weak)
make_decl_one_only (decl);
! else if (TREE_CODE (decl) == FUNCTION_DECL)
TREE_PUBLIC (decl) = 0;
else
{
if (DECL_INITIAL (decl) == 0
|| DECL_INITIAL (decl) == error_mark_node)
DECL_COMMON (decl) = 1;
--- 2370,2383 ----
{
if (flag_weak)
make_decl_one_only (decl);
! else if (TREE_CODE (decl) == FUNCTION_DECL || DECL_VIRTUAL_P (decl))
! /* We can just emit functions and vtables statically; it doesn't really
! matter if we have multiple copies. */
TREE_PUBLIC (decl) = 0;
else
{
+ /* Static data member template instantiations, however, cannot
+ have multiple copies. */
if (DECL_INITIAL (decl) == 0
|| DECL_INITIAL (decl) == error_mark_node)
DECL_COMMON (decl) = 1;
More information about the Gcc-patches
mailing list