http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45375
--- Comment #165 from Jan Hubicka <hubicka at gcc dot gnu.org> 2013-01-09 15:16:26 UTC --- OK, I tracked down the undefined reference to error: /tmp/cc0oq4BG.ltrans1.ltrans.o: requires dynamic R_X86_64_PC32 reloc against '_ZN12SkAnnotationC1ER23SkFlattenableReadBuffer' which may overflow at runtime; recompile with -fPIC it is caused by bug in Mozilla - it includes file defininig virtual function that use '_ZN12SkAnnotationC1ER23SkFlattenableReadBuffer' (in SkPaint) but it never links with implementation. Normally the function is optimized out. It is not due to fact that we never optimize out virtual functions prior inlining for devirtualization and in WPA path we forget to remove these when done. Fixed by the following patch Index: ipa-inline.c =================================================================== --- ipa-inline.c (revision 194916) +++ ipa-inline.c (working copy) @@ -1793,7 +1793,7 @@ } inline_small_functions (); - symtab_remove_unreachable_nodes (true, dump_file); + symtab_remove_unreachable_nodes (false, dump_file); free (order); /* Inline functions with a property that after inlining into all callers the Index: lto/lto.c =================================================================== --- lto/lto.c (revision 194916) +++ lto/lto.c (working copy) @@ -3215,6 +3215,7 @@ cgraph_state = CGRAPH_STATE_IPA_SSA; execute_ipa_pass_list (all_regular_ipa_passes); + symtab_remove_unreachable_nodes (false, dump_file); if (cgraph_dump_file) { Index: cgraphclones.c =================================================================== --- cgraphclones.c (revision 194916) +++ cgraphclones.c (working copy) @@ -184,6 +184,7 @@ new_node->symbol.decl = decl; symtab_register_node ((symtab_node)new_node); new_node->origin = n->origin; + new_node->symbol.lto_file_data = n->symbol.lto_file_data; if (new_node->origin) { new_node->next_nested = new_node->origin->nested;