C++ PATCH: PR 9941

Mark Mitchell mark@codesourcery.com
Thu Feb 5 01:59:00 GMT 2004


This patch fixes PR 9941, a regression on platforms without weak
symbols when using #pragma interface/#pragma implementation.

Tested on x86_64-suse-linux-gnu and hppa2.0w-hp-hpux11.11, installed
on the mainline and on the 3.4 branch.

I couldn't seem to come up with a good small test for this, and the
one in the PR is too big for inclusion in our testsuite, so there's no
test case.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2004-02-04  Mark Mitchell  <mark@codesourcery.com>

	PR c++/9941
	* rtti.c (tinfo_base_init): Use import_export_tinfo to decide the
	linkage for the typeinfo name string.

Index: rtti.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/rtti.c,v
retrieving revision 1.176
diff -c -5 -p -r1.176 rtti.c
*** rtti.c	21 Dec 2003 21:07:31 -0000	1.176
--- rtti.c	5 Feb 2004 01:48:21 -0000
*************** tinfo_base_init (tree desc, tree target)
*** 758,768 ****
      DECL_ARTIFICIAL (name_decl) = 1;
      TREE_READONLY (name_decl) = 1;
      TREE_STATIC (name_decl) = 1;
      DECL_EXTERNAL (name_decl) = 0;
      TREE_PUBLIC (name_decl) = 1;
!     comdat_linkage (name_decl);
      /* External name of the string containing the type's name has a
         special name.  */
      SET_DECL_ASSEMBLER_NAME (name_decl,
  			     mangle_typeinfo_string_for_type (target));
      DECL_INITIAL (name_decl) = name_string;
--- 758,768 ----
      DECL_ARTIFICIAL (name_decl) = 1;
      TREE_READONLY (name_decl) = 1;
      TREE_STATIC (name_decl) = 1;
      DECL_EXTERNAL (name_decl) = 0;
      TREE_PUBLIC (name_decl) = 1;
!     import_export_tinfo (name_decl, target, typeinfo_in_lib_p (target));
      /* External name of the string containing the type's name has a
         special name.  */
      SET_DECL_ASSEMBLER_NAME (name_decl,
  			     mangle_typeinfo_string_for_type (target));
      DECL_INITIAL (name_decl) = name_string;



More information about the Gcc-patches mailing list