From dfc25d72984eb5a3354e104612d0ca0129af3f98 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 25 Sep 2013 13:43:04 -0500 Subject: [PATCH] PowerPC: Fix POINTER_CHK_GUARD thread register for PPC64 --- ChangeLog | 5 +++++ sysdeps/powerpc/powerpc32/stackguard-macros.h | 9 ++++++++- sysdeps/powerpc/powerpc64/stackguard-macros.h | 11 +++++++++-- 3 files changed, 22 insertions(+), 3 deletions(-) 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)) \ ); \ -- 2.47.2