diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2012-05-14 15:16:27 -0700 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2012-05-14 15:16:27 -0700 |
commit | e02f153a1ab75b95e3991dd9dbd3b9220dc9c3ae (patch) | |
tree | 8772d54a57e1234379b342415457eedc9ec82ec2 /sysdeps | |
parent | 520ae0fd0bc4dbb57f103eedc818d6c1b39be13e (diff) | |
download | glibc-e02f153a1ab75b95e3991dd9dbd3b9220dc9c3ae.tar glibc-e02f153a1ab75b95e3991dd9dbd3b9220dc9c3ae.tar.gz glibc-e02f153a1ab75b95e3991dd9dbd3b9220dc9c3ae.tar.bz2 glibc-e02f153a1ab75b95e3991dd9dbd3b9220dc9c3ae.zip |
Update x86_64 PTR_MANGLE/PTR_DEMANGLE for x32
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/unix/sysv/linux/x86_64/sysdep.h | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h index c9c4dbdc59..aae4cb01b4 100644 --- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h +++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h @@ -342,33 +342,33 @@ /* We cannot use the thread descriptor because in ld.so we use setjmp earlier than the descriptor is initialized. */ # ifdef __ASSEMBLER__ -# define PTR_MANGLE(reg) xorq __pointer_chk_guard_local(%rip), reg; \ - rolq $17, reg -# define PTR_DEMANGLE(reg) rorq $17, reg; \ - xorq __pointer_chk_guard_local(%rip), reg +# define PTR_MANGLE(reg) xor __pointer_chk_guard_local(%rip), reg; \ + rol $2*LP_SIZE+1, reg +# define PTR_DEMANGLE(reg) ror $2*LP_SIZE+1, reg; \ + xor __pointer_chk_guard_local(%rip), reg # else -# define PTR_MANGLE(reg) asm ("xorq __pointer_chk_guard_local(%%rip), %0\n" \ - "rolq $17, %0" \ +# define PTR_MANGLE(reg) asm ("xor __pointer_chk_guard_local(%%rip), %0\n" \ + "rol $2*" LP_SIZE "+1, %0" \ : "=r" (reg) : "0" (reg)) -# define PTR_DEMANGLE(reg) asm ("rorq $17, %0\n" \ - "xorq __pointer_chk_guard_local(%%rip), %0" \ +# define PTR_DEMANGLE(reg) asm ("ror $2*" LP_SIZE "+1, %0\n" \ + "xor __pointer_chk_guard_local(%%rip), %0" \ : "=r" (reg) : "0" (reg)) # endif #else # ifdef __ASSEMBLER__ -# define PTR_MANGLE(reg) xorq %fs:POINTER_GUARD, reg; \ - rolq $17, reg -# define PTR_DEMANGLE(reg) rorq $17, reg; \ - xorq %fs:POINTER_GUARD, reg +# define PTR_MANGLE(reg) xor %fs:POINTER_GUARD, reg; \ + rol $2*LP_SIZE+1, reg +# define PTR_DEMANGLE(reg) ror $2*LP_SIZE+1, reg; \ + xor %fs:POINTER_GUARD, reg # else -# define PTR_MANGLE(var) asm ("xorq %%fs:%c2, %0\n" \ - "rolq $17, %0" \ +# define PTR_MANGLE(var) asm ("xor %%fs:%c2, %0\n" \ + "rol $2*" LP_SIZE "+1, %0" \ : "=r" (var) \ : "0" (var), \ "i" (offsetof (tcbhead_t, \ pointer_guard))) -# define PTR_DEMANGLE(var) asm ("rorq $17, %0\n" \ - "xorq %%fs:%c2, %0" \ +# define PTR_DEMANGLE(var) asm ("ror $2*" LP_SIZE "+1, %0\n" \ + "xor %%fs:%c2, %0" \ : "=r" (var) \ : "0" (var), \ "i" (offsetof (tcbhead_t, \ |