summaryrefslogtreecommitdiff
path: root/libc/sysdeps/powerpc/powerpc32/stackguard-macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/powerpc/powerpc32/stackguard-macros.h')
-rw-r--r--libc/sysdeps/powerpc/powerpc32/stackguard-macros.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libc/sysdeps/powerpc/powerpc32/stackguard-macros.h b/libc/sysdeps/powerpc/powerpc32/stackguard-macros.h
index 839f6a4b9..b3d0af830 100644
--- a/libc/sysdeps/powerpc/powerpc32/stackguard-macros.h
+++ b/libc/sysdeps/powerpc/powerpc32/stackguard-macros.h
@@ -2,3 +2,13 @@
#define STACK_CHK_GUARD \
({ uintptr_t x; asm ("lwz %0,-28680(2)" : "=r" (x)); x; })
+
+#define POINTER_CHK_GUARD \
+ ({ \
+ uintptr_t x; \
+ asm ("lwz %0,%1(2)" \
+ : "=r" (x) \
+ : "i" (offsetof (tcbhead_t, pointer_guard) - TLS_TCB_OFFSET - sizeof (tcbhead_t)) \
+ ); \
+ x; \
+ })