olga / rpms / glibc

Forked from rpms/glibc 5 years ago
Clone

Blame SOURCES/glibc-rh1445644.patch

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