> Index: varasm.c
> ===================================================================
> --- varasm.c (revision 198771)
> +++ varasm.c (working copy)
> @@ -6582,10 +6582,18 @@ default_use_anchors_for_symbol_p (const_
> {
> /* Don't use section anchors for decls that might be defined by
> other modules. */
> - if (!targetm.binds_local_p (decl))
> + if (decl_replaceable_p (decl))
> return false;
Actually looking more into this, I think decl_replaceable_p is still not correct
predicate:
bool
decl_replaceable_p (tree decl)
{
gcc_assert (DECL_P (decl));
if (!TREE_PUBLIC (decl) || DECL_COMDAT (decl))
return false;
return !decl_binds_to_current_def_p (decl);
}
I think DECL_COMDAT is not what you really want to return true for. So perhaps
you really want (TREE_PUBLIC (decl) && decl_binds_to_current_def_p)?
Honza