diff options
Diffstat (limited to 'sysdeps/unix/sysv/linux')
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/bits/setjmp.h | 5 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h | 22 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h | 20 |
5 files changed, 48 insertions, 3 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h index 355108a493..50c3f42469 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h @@ -275,6 +275,8 @@ # define PTR_MANGLE(reg, tmpreg) \ ear tmpreg,%a0; \ x reg,STACK_GUARD(tmpreg) +# define PTR_MANGLE2(reg, tmpreg) \ + x reg,STACK_GUARD(tmpreg) # define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) # else # define PTR_MANGLE(var) \ diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h index 562fc7df76..aadbf74c2b 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h @@ -277,6 +277,8 @@ sllg tmpreg,tmpreg,32; \ ear tmpreg,%a1; \ xg reg,STACK_GUARD(tmpreg) +# define PTR_MANGLE2(reg, tmpreg) \ + xg reg,STACK_GUARD(tmpreg) # define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) # else # define PTR_MANGLE(var) \ diff --git a/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h b/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h index 45aa2655ee..7dc822929f 100644 --- a/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h +++ b/sysdeps/unix/sysv/linux/sparc/bits/setjmp.h @@ -1,4 +1,5 @@ -/* Copyright (C) 1997,1999,2000,2003, 2005 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1999, 2000, 2003, 2005, 2006 + Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -60,7 +61,7 @@ typedef struct __sparc64_jmp_buf /* Test if longjmp to JMPBUF would unwind the frame containing a local variable at ADDRESS. */ #define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \ - ((unsigned long int) (address) < demangle ((jmpbuf)->uc_mcontext.mc_fp)) + ((unsigned long int) (address) < (jmpbuf)->uc_mcontext.mc_fp) #else diff --git a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h index 29c5158b9f..45f5c44d5d 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc32/sysdep.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 2002, 2003, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1997, 2002, 2003, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Miguel de Icaza <miguel@gnu.ai.mit.edu>, January 1997. @@ -214,4 +214,24 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \ #endif /* __ASSEMBLER__ */ +/* Pointer mangling support. */ +#if defined NOT_IN_libc && defined IS_IN_rtld +/* We cannot use the thread descriptor because in ld.so we use setjmp + earlier than the descriptor is initialized. */ +#else +# ifdef __ASSEMBLER__ +# define PTR_MANGLE(dreg, reg, tmpreg) \ + ld [%g7 + POINTER_GUARD], tmpreg; \ + xor reg, tmpreg, dreg +# define PTR_DEMANGLE(dreg, reg, tmpreg) PTR_MANGLE (dreg, reg, tmpreg) +# define PTR_MANGLE2(dreg, reg, tmpreg) \ + xor reg, tmpreg, dreg +# define PTR_DEMANGLE2(dreg, reg, tmpreg) PTR_MANGLE2 (dreg, reg, tmpreg) +# else +# define PTR_MANGLE(var) \ + (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) +# define PTR_DEMANGLE(var) PTR_MANGLE (var) +# endif +#endif + #endif /* linux/sparc/sysdep.h */ diff --git a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h index 071aa3a310..b30cffc5e9 100644 --- a/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h +++ b/sysdeps/unix/sysv/linux/sparc/sparc64/sysdep.h @@ -240,4 +240,24 @@ SYSCALL_ERROR_HANDLER_ENTRY(__syscall_error_handler) \ register windows. So if you poke stack memory directly you add this. */ #define STACK_BIAS 2047 +/* Pointer mangling support. */ +#if defined NOT_IN_libc && defined IS_IN_rtld +/* We cannot use the thread descriptor because in ld.so we use setjmp + earlier than the descriptor is initialized. */ +#else +# ifdef __ASSEMBLER__ +# define PTR_MANGLE(dreg, reg, tmpreg) \ + ldx [%g7 + POINTER_GUARD], tmpreg; \ + xor reg, tmpreg, dreg +# define PTR_DEMANGLE(dreg, reg, tmpreg) PTR_MANGLE (dreg, reg, tmpreg) +# define PTR_MANGLE2(dreg, reg, tmpreg) \ + xor reg, tmpreg, dreg +# define PTR_DEMANGLE2(dreg, reg, tmpreg) PTR_MANGLE2 (dreg, reg, tmpreg) +# else +# define PTR_MANGLE(var) \ + (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) +# define PTR_DEMANGLE(var) PTR_MANGLE (var) +# endif +#endif + #endif /* linux/sparc64/sysdep.h */ |