summaryrefslogtreecommitdiff
path: root/libc/sysdeps/i386/stackguard-macros.h
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/i386/stackguard-macros.h')
-rw-r--r--libc/sysdeps/i386/stackguard-macros.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/libc/sysdeps/i386/stackguard-macros.h b/libc/sysdeps/i386/stackguard-macros.h
index 8c31e197e..039762927 100644
--- a/libc/sysdeps/i386/stackguard-macros.h
+++ b/libc/sysdeps/i386/stackguard-macros.h
@@ -2,3 +2,11 @@
#define STACK_CHK_GUARD \
({ uintptr_t x; asm ("movl %%gs:0x14, %0" : "=r" (x)); x; })
+
+#define POINTER_CHK_GUARD \
+ ({ \
+ uintptr_t x; \
+ asm ("movl %%gs:%c1, %0" : "=r" (x) \
+ : "i" (offsetof (tcbhead_t, pointer_guard))); \
+ x; \
+ })