summaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-out.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-20 21:10:46 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-20 21:10:46 +0000
commit6e673e69bfe6589a313a77485a3e74d6aa4ad6e7 (patch)
tree840116a4decf1497419fc4f57051a92015fa008f /gcc/lto-streamer-out.c
parent1f853e71e00f2dadb92039894f5a722fe4cc6fee (diff)
downloadgcc-6e673e69bfe6589a313a77485a3e74d6aa4ad6e7.tar.gz
* cgraph.c (ld_plugin_symbol_resolution_names): New.
(dump_cgraph_node): Dump resolution. * cgraph.h (ld_plugin_symbol_resolution_names): Declare. (cgraph_comdat_can_be_unshared_p): Dclare. * lto-streamer-out.c (produce_symtab): Use cgraph_comdat_can_be_unshared_p. * ipa.c (cgraph_address_taken_from_non_vtable_p): New function. (cgraph_comdat_can_be_unshared_p): New function based on logic in cgraph_externally_visible_p. (cgraph_externally_visible_p): Use it. (varpool_externally_visible_p): Virtual tables can be unshared. * varpool.c (dump_varpool_node): Dump resolution. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166985 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/lto-streamer-out.c')
-rw-r--r--gcc/lto-streamer-out.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index 20e39913044..b6414b69ac2 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -2492,7 +2492,7 @@ produce_symtab (struct output_block *ob,
if (DECL_EXTERNAL (node->decl))
continue;
if (DECL_COMDAT (node->decl)
- && cgraph_can_remove_if_no_direct_calls_p (node))
+ && cgraph_comdat_can_be_unshared_p (node))
continue;
if (node->alias || node->global.inlined_to)
continue;
@@ -2506,7 +2506,7 @@ produce_symtab (struct output_block *ob,
if (!DECL_EXTERNAL (node->decl))
continue;
if (DECL_COMDAT (node->decl)
- && cgraph_can_remove_if_no_direct_calls_p (node))
+ && cgraph_comdat_can_be_unshared_p (node))
continue;
if (node->alias || node->global.inlined_to)
continue;
@@ -2521,6 +2521,14 @@ produce_symtab (struct output_block *ob,
vnode = lto_varpool_encoder_deref (varpool_encoder, i);
if (DECL_EXTERNAL (vnode->decl))
continue;
+ /* COMDAT virtual tables can be unshared. Do not declare them
+ in the LTO symbol table to prevent linker from forcing them
+ into the output. */
+ if (DECL_COMDAT (vnode->decl)
+ && !vnode->force_output
+ && vnode->finalized
+ && DECL_VIRTUAL_P (vnode->decl))
+ continue;
if (vnode->alias)
continue;
write_symbol (cache, &stream, vnode->decl, seen, false);
@@ -2532,6 +2540,11 @@ produce_symtab (struct output_block *ob,
vnode = lto_varpool_encoder_deref (varpool_encoder, i);
if (!DECL_EXTERNAL (vnode->decl))
continue;
+ if (DECL_COMDAT (vnode->decl)
+ && !vnode->force_output
+ && vnode->finalized
+ && DECL_VIRTUAL_P (vnode->decl))
+ continue;
if (vnode->alias)
continue;
write_symbol (cache, &stream, vnode->decl, seen, false);