aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/class.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/class.c')
-rw-r--r--gcc/cp/class.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index 605dd16..38339f2 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -8356,6 +8356,12 @@ build_ctor_vtbl_group (tree binfo, tree t)
construction vtable group. */
vtbl = build_vtable (t, id, ptr_type_node);
DECL_CONSTRUCTION_VTABLE_P (vtbl) = 1;
+ /* Don't export construction vtables from shared libraries. Even on
+ targets that don't support hidden visibility, this tells
+ can_refer_decl_in_current_unit_p not to assume that it's safe to
+ access from a different compilation unit (bz 54314). */
+ DECL_VISIBILITY (vtbl) = VISIBILITY_HIDDEN;
+ DECL_VISIBILITY_SPECIFIED (vtbl) = true;
v = NULL;
accumulate_vtbl_inits (binfo, TYPE_BINFO (TREE_TYPE (binfo)),