http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57038
--- Comment #16 from Jan Hubicka <hubicka at gcc dot gnu.org> --- OK, I think I found the bug. Weakrefs are considered to be external but they need to be duplicated. Does the following fix the problem? Index: lto-partition.c =================================================================== --- lto-partition.c (revision 198803) +++ lto-partition.c (working copy) @@ -59,6 +59,10 @@ get_symbol_class (symtab_node node) if (cnode && cnode->global.inlined_to) return SYMBOL_DUPLICATE; + /* Weakref aliases are always duplicated. */ + if (lookup_attribute ("weakref", DECL_ATTRIBUTES (node->symbol.decl))) + return SYMBOL_DUPLICATE; + /* External declarations are external. */ if (DECL_EXTERNAL (node->symbol.decl)) return SYMBOL_EXTERNAL; @@ -79,10 +83,6 @@ get_symbol_class (symtab_node node) else if (!cgraph (node)->analyzed) return SYMBOL_EXTERNAL; - /* Weakref aliases are always duplicated. */ - if (lookup_attribute ("weakref", DECL_ATTRIBUTES (node->symbol.decl))) - return SYMBOL_DUPLICATE; - /* Comdats are duplicated to every use unless they are keyed. Those do not need duplication. */ if (DECL_COMDAT (node->symbol.decl) I hav emore involved patch to fix weakrefs in testing, but this may be enough for this particular bug. Honza