aboutsummaryrefslogtreecommitdiff
path: root/elf
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2012-05-11 16:31:34 -0700
committerH.J. Lu <hjl.tools@gmail.com>2012-05-11 16:31:34 -0700
commit9fb1a21f4d33c4c82719d6130e149eb2c5a51ae8 (patch)
tree12cff7b38a7113a36c170faa8d9985978f74bafd /elf
parentd3c6600440bfa95db3bb1ddd6c75dc43cffb79e7 (diff)
downloadglibc-9fb1a21f4d33c4c82719d6130e149eb2c5a51ae8.tar
glibc-9fb1a21f4d33c4c82719d6130e149eb2c5a51ae8.tar.gz
glibc-9fb1a21f4d33c4c82719d6130e149eb2c5a51ae8.tar.bz2
glibc-9fb1a21f4d33c4c82719d6130e149eb2c5a51ae8.zip
Add x32 support to STACK_CHK_GUARD
Diffstat (limited to 'elf')
-rw-r--r--elf/stackguard-macros.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/elf/stackguard-macros.h b/elf/stackguard-macros.h
index a9889cf7b2..0cad31550c 100644
--- a/elf/stackguard-macros.h
+++ b/elf/stackguard-macros.h
@@ -5,7 +5,9 @@
({ uintptr_t x; asm ("movl %%gs:0x14, %0" : "=r" (x)); x; })
#elif defined __x86_64__
# define STACK_CHK_GUARD \
- ({ uintptr_t x; asm ("movq %%fs:0x28, %0" : "=r" (x)); x; })
+ ({ uintptr_t x; \
+ asm ("mov %%fs:%c1, %0" : "=r" (x) \
+ : "i" (offsetof (tcbhead_t, stack_guard))); x; })
#elif defined __powerpc64__
# define STACK_CHK_GUARD \
({ uintptr_t x; asm ("ld %0,-28688(13)" : "=r" (x)); x; })