+2015-02-19 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/65074
+ * varasm.c (default_binds_local_p_2): Don't test node->definition;
+ test DECL_EXTERNAL independent of symtab_node.
+
2015-02-19 Jakub Jelinek <jakub@redhat.com>
PR lto/65012
because dynamic linking might overwrite symbols
in shared libraries. */
bool resolved_locally = false;
- bool defined_locally = false;
+ bool defined_locally = !DECL_EXTERNAL (exp);
if (symtab_node *node = symtab_node::get (exp))
{
- if ((node->definition && !DECL_EXTERNAL (node->decl))
- || node->in_other_partition)
- {
- defined_locally = true;
- resolved_locally = (weak_dominate && !shlib);
- }
+ if (node->in_other_partition)
+ defined_locally = true;
if (resolution_to_local_definition_p (node->resolution))
defined_locally = resolved_locally = true;
else if (resolution_local_p (node->resolution))
resolved_locally = true;
}
+ if (defined_locally && weak_dominate && !shlib)
+ resolved_locally = true;
/* Undefined weak symbols are never defined locally. */
if (DECL_WEAK (exp) && !defined_locally)