SYMBOL_REF_FLAGS (symbol) = flags;
}
+
bool
i386_pe_binds_local_p (const_tree exp)
{
- /* PE does not do dynamic binding. Indeed, the only kind of
- non-local reference comes from a dllimport'd symbol. */
if ((TREE_CODE (exp) == VAR_DECL || TREE_CODE (exp) == FUNCTION_DECL)
&& DECL_DLLIMPORT_P (exp))
return false;
- /* Or a weak one, now that they are supported. */
- if ((TREE_CODE (exp) == VAR_DECL || TREE_CODE (exp) == FUNCTION_DECL)
- && DECL_WEAK (exp))
- return false;
-
- return true;
+ /* External public symbols, which aren't weakref-s,
+ have local-binding for PE targets. */
+ if (DECL_P (exp)
+ && !lookup_attribute ("weakref", DECL_ATTRIBUTES (exp))
+ && TREE_PUBLIC (exp)
+ && DECL_EXTERNAL (exp))
+ return true;
+ return default_binds_local_p_1 (exp, 0);
}
/* Also strip the fastcall prefix and stdcall suffix. */