]> 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:35:19 +0000 (07:35 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Tue, 2 Nov 1999 07:35:19 +0000 (02:35 -0500)
* decl2.c (maybe_make_one_only): Always make things comdat on
ELF targets, too.

From-SVN: r30342

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

index efa30edcad2baccec7996f19d393f9083c933cc5..605bafc0a52c29d11f88183ff884cfc244846d69 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.
+
 Sun Oct 24 23:54:10 PDT 1999 Jeff Law  (law@cygnus.com)
 
        * gcc-2.95.2 Released.
index d6fb7bf90fad01a0111e4ef7e7faa0aff8dc4f73..bdeadb502611351b9e09645717717893b4489442 100644 (file)
@@ -2485,9 +2485,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