aboutsummaryrefslogtreecommitdiff
path: root/gcc/lto-streamer-out.c
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@gcc.gnu.org>2010-11-20 21:10:46 +0000
committerJan Hubicka <hubicka@gcc.gnu.org>2010-11-20 21:10:46 +0000
commit430c6cebe1f5acbbc209c12717cfe085c759f73e (patch)
tree840116a4decf1497419fc4f57051a92015fa008f /gcc/lto-streamer-out.c
parent671769c38a2a4e4f76817307be3eb871f1acc399 (diff)
downloadgcc-430c6cebe1f5acbbc209c12717cfe085c759f73e.zip
gcc-430c6cebe1f5acbbc209c12717cfe085c759f73e.tar.gz
gcc-430c6cebe1f5acbbc209c12717cfe085c759f73e.tar.bz2
cgraph.c (ld_plugin_symbol_resolution_names): New.
* 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. From-SVN: r166985
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 20e3991..b6414b6 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);