On 02/04/2015 03:29 PM, H.J. Lu wrote:
> +++ b/gcc/varasm.c
> @@ -6826,11 +6826,17 @@ default_binds_local_p_1 (const_tree exp, int shlib)
>        && (TREE_STATIC (exp) || DECL_EXTERNAL (exp)))
>      {
>        varpool_node *vnode = varpool_node::get (exp);
> -      if (vnode && (resolution_local_p (vnode->resolution) || 
> vnode->in_other_partition))
> -     resolved_locally = true;
> -      if (vnode
> -       && resolution_to_local_definition_p (vnode->resolution))
> -     resolved_to_local_def = true;
> +      /* If not building shared library, common or initialized symbols
> +      are also resolved locally, regardless they are weak or not.  */
> +      if (vnode)
> +     {
> +       if ((!shlib && vnode->definition)
> +           || vnode->in_other_partition
> +           || resolution_local_p (vnode->resolution))
> +         resolved_locally = true;
> +       if (resolution_to_local_definition_p (vnode->resolution))
> +         resolved_to_local_def = true;
> +     }

This is only true if the target uses COPY relocations, which is not universally
true for all ELF targets.

You can't just make this change here in varasm.c and change everyone.


r~

Reply via email to