]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport 51469
authorMichael Meissner <meissner@the-meissners.org>
Fri, 9 Dec 2011 19:11:01 +0000 (19:11 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Fri, 9 Dec 2011 19:11:01 +0000 (19:11 +0000)
From-SVN: r182172

gcc/ChangeLog
gcc/varasm.c

index 21a68e4e7d236fc6c3c76bed23acd38c4b0209af..af1feae0e5836ccd5818b695d486839333c3b688 100644 (file)
@@ -1,3 +1,12 @@
+2011-12-09  Michael Meissner  <meissner@the-meissners.org>
+
+       Backport from mainline
+       2011-12-09  Michael Meissner  <meissner@the-meissners.org>
+
+       PR rtl-optimization/51469
+       * varasm.c (default_binds_local_p_1): If the symbol is a gnu
+       indirect function, mark the symbol as non-local.
+
 2011-12-09  Jakub Jelinek  <jakub@redhat.com>
 
        Backport from mainline
index 654c27ad374defa9863d9c44a562c98142dc2392..053404302a25908354507137ff35ae9daabe7bd9 100644 (file)
@@ -6751,11 +6751,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))