- /* Normally EXTERNAL flag is used to mark external inlines,
- however for aliases it seems to be allowed to use it w/o
- any meaning. See gcc.dg/attr-alias-3.c
- However for weakref we insist on EXTERNAL flag being set.
- See gcc.dg/attr-alias-5.c */
- if (DECL_EXTERNAL (p->decl))
- DECL_EXTERNAL (p->decl)
- = lookup_attribute ("weakref",
- DECL_ATTRIBUTES (p->decl)) != NULL;
- varpool_create_variable_alias (p->decl, target_vnode->symbol.decl);
- VEC_unordered_remove (alias_pair, alias_pairs, i);
- }
- /* Weakrefs with target not defined in current unit are easy to handle; they
- behave just as external variables except we need to note the alias flag
- to later output the weakref pseudo op into asm file. */
- else if (lookup_attribute ("weakref", DECL_ATTRIBUTES (p->decl)) != NULL
- && (TREE_CODE (p->decl) == FUNCTION_DECL
- ? (varpool_node_for_asm (p->target) == NULL)
- : (cgraph_node_for_asm (p->target) == NULL)))
- {
- if (TREE_CODE (p->decl) == FUNCTION_DECL)
- cgraph_get_create_node (p->decl)->alias = true;
- else
- varpool_get_node (p->decl)->alias = true;
- DECL_EXTERNAL (p->decl) = 1;
- VEC_unordered_remove (alias_pair, alias_pairs, i);