aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorMichael Meissner <meissner@the-meissners.org>2011-12-09 17:10:27 +0000
committerMichael Meissner <meissner@the-meissners.org>2011-12-09 17:10:27 +0000
commit4016b3ea3bd30cdd80c24ee4af2e9706ed54a0f6 (patch)
treeac24d21fa760d2cf985f1c62a77df7eb471f64e4 /gcc/varasm.c
parent56d3045943d3faffb4a5b4715879cde9d6a6e6e2 (diff)
Fix PR51469 (attr-ifunc fails on ppc); Make #pragma GCC target ("...") change macros on PPC
git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@182169 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 78dc4cd83f0..86134672cbe 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -6911,11 +6911,14 @@ default_binds_local_p_1 (const_tree exp, int shlib)
/* A non-decl is an entry in the constant pool. */
if (!DECL_P (exp))
local_p = true;
- /* Weakrefs may not bind locally, even though the weakref itself is
- always static and therefore local.
- FIXME: We can resolve this more curefuly by looking at the weakref
- alias. */
- else if (lookup_attribute ("weakref", DECL_ATTRIBUTES (exp)))
+ /* Weakrefs may not bind locally, even though the weakref itself is always
+ static and therefore local. Similarly, the resolver for ifunc functions
+ might resolve to a non-local function.
+ FIXME: We can resolve the weakref case more curefuly by looking at the
+ weakref alias. */
+ else if (lookup_attribute ("weakref", DECL_ATTRIBUTES (exp))
+ || (TREE_CODE (exp) == FUNCTION_DECL
+ && lookup_attribute ("ifunc", DECL_ATTRIBUTES (exp))))
local_p = false;
/* Static variables are always local. */
else if (! TREE_PUBLIC (exp))