aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@yorick.cygnus.com>1999-11-02 07:33:05 +0000
committerJason Merrill <jason@gcc.gnu.org>1999-11-02 02:33:05 -0500
commitb78121f657b9b19cf3c6f3f085451825eb8edc8e (patch)
tree54dc24c48cf1365c5ec8f2561618f0741c34673f /gcc
parentc4d6cee3898682503735991c01c0952f58e6d1c6 (diff)
downloadgcc-b78121f657b9b19cf3c6f3f085451825eb8edc8e.zip
gcc-b78121f657b9b19cf3c6f3f085451825eb8edc8e.tar.gz
gcc-b78121f657b9b19cf3c6f3f085451825eb8edc8e.tar.bz2
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: r30341
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl2.c10
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index eb67839..58a962f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 7b69bec..6ecd094 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -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