From: Adhemerval Zanella Date: Wed, 25 Sep 2013 18:43:04 +0000 (-0500) Subject: PowerPC: Fix POINTER_CHK_GUARD thread register for PPC64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dfc25d72984eb5a3354e104612d0ca0129af3f98;p=thirdparty%2Fglibc.git PowerPC: Fix POINTER_CHK_GUARD thread register for PPC64 --- diff --git a/ChangeLog b/ChangeLog index 499d43cdb64..6fc9ebcf8ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2013-09-25 Adhemerval Zanella + + * sysdeps/powerpc/powerpc64/stackguard-macros.h (POINTER_CHK_GUARD: + Fix thread ID register. + 2014-01-20 Adhemerval Zanella [BZ#16431] diff --git a/sysdeps/powerpc/powerpc32/stackguard-macros.h b/sysdeps/powerpc/powerpc32/stackguard-macros.h index b3d0af830f2..a4d771cec0d 100644 --- a/sysdeps/powerpc/powerpc32/stackguard-macros.h +++ b/sysdeps/powerpc/powerpc32/stackguard-macros.h @@ -1,7 +1,14 @@ #include #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 \ ({ \ diff --git a/sysdeps/powerpc/powerpc64/stackguard-macros.h b/sysdeps/powerpc/powerpc64/stackguard-macros.h index 4620f96b864..308d3cdc7e6 100644 --- a/sysdeps/powerpc/powerpc64/stackguard-macros.h +++ b/sysdeps/powerpc/powerpc64/stackguard-macros.h @@ -1,12 +1,19 @@ #include #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)) \ ); \