fa3bfd
commit e0ed2fb40a0e29c43cf60addc74741dab15f2e05
fa3bfd
Author: H.J. Lu <hjl.tools@gmail.com>
fa3bfd
Date:   Fri Mar 6 04:55:56 2015 -0800
fa3bfd
fa3bfd
    Replace __attribute__((visibility("protected")))
fa3bfd
    
fa3bfd
    With copy relocation, address of protected data defined in the shared
fa3bfd
    library may be external.  Compiler shouldn't asssume protected data will
fa3bfd
    be local.  But due to
fa3bfd
    
fa3bfd
    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248
fa3bfd
    
fa3bfd
    __attribute__((visibility("protected"))) doesn't work correctly, we need
fa3bfd
    to use asm (".protected xxx") instead.
fa3bfd
    
fa3bfd
            * elf/ifuncdep2.c (global): Replace
fa3bfd
            __attribute__((visibility("protected"))) with
fa3bfd
            asm (".protected global").
fa3bfd
            * elf/ifuncmod1.c (global): Likewise.
fa3bfd
            * elf/ifuncmod5.c (global): Likewise.
fa3bfd
fa3bfd
Index: b/elf/ifuncdep2.c
fa3bfd
===================================================================
fa3bfd
--- a/elf/ifuncdep2.c
fa3bfd
+++ b/elf/ifuncdep2.c
fa3bfd
@@ -2,7 +2,13 @@
fa3bfd
 
fa3bfd
 #include "ifunc-sel.h"
fa3bfd
 
fa3bfd
-int global __attribute__ ((visibility ("protected"))) = -1;
fa3bfd
+int global = -1;
fa3bfd
+/* Can't use __attribute__((visibility("protected"))) until the GCC bug:
fa3bfd
+
fa3bfd
+   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248
fa3bfd
+
fa3bfd
+   is fixed.  */
fa3bfd
+asm (".protected global");
fa3bfd
 
fa3bfd
 static int
fa3bfd
 one (void)
fa3bfd
Index: b/elf/ifuncmod1.c
fa3bfd
===================================================================
fa3bfd
--- a/elf/ifuncmod1.c
fa3bfd
+++ b/elf/ifuncmod1.c
fa3bfd
@@ -6,7 +6,13 @@
fa3bfd
  */
fa3bfd
 #include "ifunc-sel.h"
fa3bfd
 
fa3bfd
-int global __attribute__ ((visibility ("protected"))) = -1;
fa3bfd
+int global = -1;
fa3bfd
+/* Can't use __attribute__((visibility("protected"))) until the GCC bug:
fa3bfd
+
fa3bfd
+   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248
fa3bfd
+
fa3bfd
+   is fixed.  */
fa3bfd
+asm (".protected global");
fa3bfd
 
fa3bfd
 static int
fa3bfd
 one (void)
fa3bfd
Index: b/elf/ifuncmod5.c
fa3bfd
===================================================================
fa3bfd
--- a/elf/ifuncmod5.c
fa3bfd
+++ b/elf/ifuncmod5.c
fa3bfd
@@ -1,7 +1,13 @@
fa3bfd
 /* Test STT_GNU_IFUNC symbols without direct function call.  */
fa3bfd
 #include "ifunc-sel.h"
fa3bfd
 
fa3bfd
-int global __attribute__ ((visibility ("protected"))) = -1;
fa3bfd
+int global = -1;
fa3bfd
+/* Can't use __attribute__((visibility("protected"))) until the GCC bug:
fa3bfd
+
fa3bfd
+   https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65248
fa3bfd
+
fa3bfd
+   is fixed.  */
fa3bfd
+asm (".protected global");
fa3bfd
 
fa3bfd
 static int
fa3bfd
 one (void)