]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Add x32 support to STACK_CHK_GUARD
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 11 May 2012 23:31:34 +0000 (16:31 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 11 May 2012 23:31:34 +0000 (16:31 -0700)
ChangeLog
elf/stackguard-macros.h

index 9d8a7136c335a239c4728f2747a336f5cb6bb636..0c4a814167a7991311fa8d1c0bb0e6f25c86b0cc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-05-11  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * elf/stackguard-macros.h (STACK_CHK_GUARD) [__x86_64__]: Use
+       "%c1" with "i" (offsetof (tcbhead_t, stack_guard)).
+
 2012-05-11  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elf/tls-macros.h (TLS_LE): Use mov instead of movq to load
index a9889cf7b274a3e689e9ae045454938ef94bdd5a..0cad31550c068c53c40444deebbaf7b5d63f60ed 100644 (file)
@@ -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; })