]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
PowerPC: Fix POINTER_CHK_GUARD thread register for PPC64
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Wed, 25 Sep 2013 18:43:04 +0000 (13:43 -0500)
committerAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Fri, 16 Jan 2015 16:56:06 +0000 (11:56 -0500)
ChangeLog
sysdeps/powerpc/powerpc32/stackguard-macros.h
sysdeps/powerpc/powerpc64/stackguard-macros.h

index 499d43cdb64919ea09c392c6af566c7c5fbb208a..6fc9ebcf8ab58f9d34ef5da0939c187239b73ccd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2013-09-25  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
+
+       * sysdeps/powerpc/powerpc64/stackguard-macros.h (POINTER_CHK_GUARD:
+       Fix thread ID register.
+
 2014-01-20  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
 
        [BZ#16431]
index b3d0af830f2e0f82dd61c64e1365f54c6f2443fb..a4d771cec0d37b5560e2f7e5a405ca4f2a9a0c82 100644 (file)
@@ -1,7 +1,14 @@
 #include <stdint.h>
 
 #define STACK_CHK_GUARD \
-  ({ uintptr_t x; asm ("lwz %0,-28680(2)" : "=r" (x)); x; })
+  ({                                                                                           \
+     uintptr_t x;                                                                              \
+     asm ("lwz %0,%1(2)"                                                                       \
+         : "=r" (x)                                                                            \
+         : "i" (offsetof (tcbhead_t, stack_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t))       \
+         );                                                                                    \
+     x;                                                                                                \
+   })
 
 #define POINTER_CHK_GUARD \
   ({                                                                                           \
index 4620f96b86423895e6ddddf4e2cad40ddecd2379..308d3cdc7e653ec8c82c176b000965f3c0bc3d5d 100644 (file)
@@ -1,12 +1,19 @@
 #include <stdint.h>
 
 #define STACK_CHK_GUARD \
-  ({ uintptr_t x; asm ("ld %0,-28688(13)" : "=r" (x)); x; })
+  ({                                                                                           \
+     uintptr_t x;                                                                              \
+     asm ("ld %0,%1(13)"                                                                               \
+         : "=r" (x)                                                                            \
+         : "i" (offsetof (tcbhead_t, stack_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t))       \
+         );                                                                                    \
+     x;                                                                                                \
+   })
 
 #define POINTER_CHK_GUARD \
   ({                                                                                           \
      uintptr_t x;                                                                              \
-     asm ("ld %0,%1(2)"                                                                                \
+     asm ("ld %0,%1(13)"                                                                               \
          : "=r" (x)                                                                            \
          : "i" (offsetof (tcbhead_t, pointer_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t))     \
          );                                                                                    \