From: Richard Henderson Date: Thu, 19 Feb 2015 15:14:24 +0000 (-0800) Subject: re PR middle-end/65074 (r220674 broke C++ PIEs) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0ff5fade6a3eecd0590b050ec4bb4288a0ddf907;p=gcc.git re PR middle-end/65074 (r220674 broke C++ PIEs) PR middle-end/65074 * varasm.c (default_binds_local_p_2): Don't test node->definition; test DECL_EXTERNAL independent of symtab_node. From-SVN: r220816 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a3045581944..ac52a2cc6e8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-02-19 Richard Henderson + + 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 PR lto/65012 diff --git a/gcc/varasm.c b/gcc/varasm.c index dc7cfd7acde..8173207b497 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -6828,20 +6828,18 @@ default_binds_local_p_2 (const_tree exp, bool shlib, bool weak_dominate) 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)