]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl2.c (maybe_make_one_only): Always make things comdat on ELF targets, too.
authorJason Merrill <jason@yorick.cygnus.com>
Tue, 2 Nov 1999 07:33:05 +0000 (07:33 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 2 Nov 1999 07:33:05 +0000 (02:33 -0500)
* decl2.c (maybe_make_one_only): Always make things comdat on
ELF targets, too.

From-SVN: r30341

gcc/cp/ChangeLog
gcc/cp/decl2.c

index eb67839a9cb971ca2e8da1f555d8734a117fb789..58a962f4bc3759649568d4398b118a7d6d282518 100644 (file)
@@ -1,3 +1,8 @@
+1999-11-01  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * decl2.c (maybe_make_one_only): Always make things comdat on
+       ELF targets, too.
+
 1999-10-31  Mark Mitchell  <mark@codesourcery.com>
 
        * decl.c (finish_function): Call free_after_parsing for functions
index 7b69bec0124e986a8331c8683a96fddca9c406fc..6ecd0946b1dc21a461c12b3cfdef1526472e22bb 100644 (file)
@@ -2365,9 +2365,13 @@ void
 maybe_make_one_only (decl)
      tree decl;
 {
-  /* This is not necessary on targets that support weak symbols, because
-     the implicit instantiations will defer to the explicit one.  */     
-  if (! supports_one_only () || SUPPORTS_WEAK)
+  /* We used to say that this was not necessary on targets that support weak
+     symbols, because the implicit instantiations will defer to the explicit
+     one.  However, that's not actually the case in SVR4; a strong definition
+     after a weak one is an error.  Also, not making explicit
+     instantiations one_only means that we can end up with two copies of
+     some template instantiations. */
+  if (! supports_one_only ())
     return;
 
   /* We can't set DECL_COMDAT on functions, or finish_file will think