Hi,

This patch adds weak linkage to internal TypeInfo data on top of the
existing DECL_COMDAT, which helps in the unlikely event that two of the
same TypeInfo data ends up in multiple places.

Tested on x86_64-linux-gnu and committed to mainline.

Regards
Iain
---

gcc/d/ChangeLog:

        * typeinfo.cc (TypeInfoVisitor::internal_reference): Call
        d_comdat_linkage on generated decl.

---
 gcc/d/typeinfo.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/d/typeinfo.cc b/gcc/d/typeinfo.cc
index 07011deaf6f..90a44944f4c 100644
--- a/gcc/d/typeinfo.cc
+++ b/gcc/d/typeinfo.cc
@@ -358,7 +358,7 @@ class TypeInfoVisitor : public Visitor
     DECL_EXTERNAL (decl) = 0;
     TREE_PUBLIC (decl) = 1;
     DECL_VISIBILITY (decl) = VISIBILITY_INTERNAL;
-    DECL_COMDAT (decl) = 1;
+    d_comdat_linkage (decl);
     d_pushdecl (decl);
 
     return decl;
-- 
2.20.1

Reply via email to