From: Jason Merrill Date: Tue, 2 Nov 1999 07:35:19 +0000 (+0000) Subject: decl2.c (maybe_make_one_only): Always make things comdat on ELF targets, too. X-Git-Tag: prereleases/gcc-2.95.3-test1~108 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0217015cfed0ddc8da932d62ab3b6fcb8b6ba9e4;p=thirdparty%2Fgcc.git decl2.c (maybe_make_one_only): Always make things comdat on ELF targets, too. * decl2.c (maybe_make_one_only): Always make things comdat on ELF targets, too. From-SVN: r30342 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index efa30edcad2b..605bafc0a52c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +1999-11-01 Jason Merrill + + * 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. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index d6fb7bf90fad..bdeadb502611 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -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