From 5ad77144942c0ea0a3f3c71d4ddccdf91e64771c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 30 Dec 2005 21:04:04 +0000 Subject: [PATCH] * sysdeps/powerpc/powerpc64/setjmp-common.S: Make sure pointer guard value doesn't survive in a registers when the function returns. * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S: Likewise. * sysdeps/powerpc/powerpc32/setjmp-common.S: Likewise. 2005-12-30 Jakub Jelinek * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Define PTR_MANGLE2. * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Define PTR_MANGLE2 and PTR_DEMANGLE2. * sysdeps/powerpc/powerpc64/__longjmp-common.S: Use PTR_DEMANGLE2. * sysdeps/powerpc/powerpc64/setjmp-common.S: Use PTR_MANGLE2. * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S: Likewise. * sysdeps/powerpc/powerpc32/setjmp-common.S: Likewise. 2005-12-30 Ulrich Drepper --- ChangeLog | 18 ++++++++++++++++++ sysdeps/powerpc/powerpc32/fpu/setjmp-common.S | 12 ++++++------ sysdeps/powerpc/powerpc32/setjmp-common.S | 3 ++- sysdeps/powerpc/powerpc64/__longjmp-common.S | 2 +- sysdeps/powerpc/powerpc64/setjmp-common.S | 14 ++++++++------ .../unix/sysv/linux/powerpc/powerpc32/sysdep.h | 5 +++-- .../unix/sysv/linux/powerpc/powerpc64/sysdep.h | 3 +++ 7 files changed, 41 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8aab971cd..a649c42a54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2005-12-30 Ulrich Drepper + + * sysdeps/powerpc/powerpc64/setjmp-common.S: Make sure pointer guard + value doesn't survive in a registers when the function returns. + * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S: Likewise. + * sysdeps/powerpc/powerpc32/setjmp-common.S: Likewise. + +2005-12-30 Jakub Jelinek + + * sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h: Define + PTR_MANGLE2. + * sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h: Define + PTR_MANGLE2 and PTR_DEMANGLE2. + * sysdeps/powerpc/powerpc64/__longjmp-common.S: Use PTR_DEMANGLE2. + * sysdeps/powerpc/powerpc64/setjmp-common.S: Use PTR_MANGLE2. + * sysdeps/powerpc/powerpc32/fpu/setjmp-common.S: Likewise. + * sysdeps/powerpc/powerpc32/setjmp-common.S: Likewise. + 2005-12-30 Ulrich Drepper * sysdeps/unix/sysv/linux/ia64/bits/setjmp.h (_JMPBUF_UNWINDS): diff --git a/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S b/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S index dae79046d3..3afcf66fb9 100644 --- a/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S +++ b/sysdeps/powerpc/powerpc32/fpu/setjmp-common.S @@ -1,5 +1,5 @@ /* setjmp for PowerPC. - Copyright (C) 1995-99, 2000, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1995-2000, 2003, 2004, 2005 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 @@ -34,7 +34,7 @@ ENTRY (BP_SYM (__sigsetjmp)) #ifdef PTR_MANGLE mr r5,r1 - PTR_MANGLE(r5, r10) + PTR_MANGLE(r5, r6) stw r5,(JB_GPR1*4)(3) #else stw r1,(JB_GPR1*4)(3) @@ -43,7 +43,7 @@ ENTRY (BP_SYM (__sigsetjmp)) stw r14,((JB_GPRS+0)*4)(3) stfd fp14,((JB_FPRS+0*2)*4)(3) #ifdef PTR_MANGLE - PTR_MANGLE (r0, r10) + PTR_MANGLE2 (r0, r6) #endif stw r0,(JB_LR*4)(3) stw r15,((JB_GPRS+1)*4)(3) @@ -104,9 +104,9 @@ ENTRY (BP_SYM (__sigsetjmp)) lwz r5,0(r5) # endif # else - lis r5,_dl_hwcap@ha - lwz r5,_dl_hwcap@l(r5) -#endif + lis r6,_dl_hwcap@ha + lwz r5,_dl_hwcap@l(r6) +# endif andis. r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16) beq L(no_vmx) la r5,((JB_VRS)*4)(3) diff --git a/sysdeps/powerpc/powerpc32/setjmp-common.S b/sysdeps/powerpc/powerpc32/setjmp-common.S index 35740923d2..69d36cce03 100644 --- a/sysdeps/powerpc/powerpc32/setjmp-common.S +++ b/sysdeps/powerpc/powerpc32/setjmp-common.S @@ -43,7 +43,8 @@ ENTRY (BP_SYM (__sigsetjmp)) mflr r0 stw r14,((JB_GPRS+0)*4)(3) #ifdef PTR_MANGLE - PTR_MANGLE (r0, r10) + PTR_MANGLE2 (r0, r10) + li r10,0 #endif stw r0,(JB_LR*4)(3) stw r15,((JB_GPRS+1)*4)(3) diff --git a/sysdeps/powerpc/powerpc64/__longjmp-common.S b/sysdeps/powerpc/powerpc64/__longjmp-common.S index 82d1abd3ce..bf7e32446d 100644 --- a/sysdeps/powerpc/powerpc64/__longjmp-common.S +++ b/sysdeps/powerpc/powerpc64/__longjmp-common.S @@ -132,7 +132,7 @@ L(no_vmx): ld r20,((JB_GPRS+6)*8)(r3) lfd fp20,((JB_FPRS+6)*8)(r3) #ifdef PTR_DEMANGLE - PTR_DEMANGLE (r0, r25) + PTR_DEMANGLE2 (r0, r25) #endif mtlr r0 /* std r2,40(r1) Restore the TOC save area. */ diff --git a/sysdeps/powerpc/powerpc64/setjmp-common.S b/sysdeps/powerpc/powerpc64/setjmp-common.S index 9660302ba5..11ecedf2c1 100644 --- a/sysdeps/powerpc/powerpc64/setjmp-common.S +++ b/sysdeps/powerpc/powerpc64/setjmp-common.S @@ -48,7 +48,7 @@ JUMPTARGET(GLUE(__sigsetjmp,_ent)): CHECK_BOUNDS_BOTH_WIDE_LIT (r3, r8, r9, JB_SIZE) #ifdef PTR_MANGLE mr r5, r1 - PTR_MANGLE (r5, r10) + PTR_MANGLE (r5, r6) std r5,(JB_GPR1*8)(3) #else std r1,(JB_GPR1*8)(3) @@ -63,7 +63,7 @@ JUMPTARGET(GLUE(__sigsetjmp,_ent)): std r14,((JB_GPRS+0)*8)(3) stfd fp14,((JB_FPRS+0)*8)(3) #ifdef PTR_MANGLE - PTR_MANGLE (r0, r10) + PTR_MANGLE2 (r0, r6) #endif std r0,(JB_LR*8)(3) std r15,((JB_GPRS+1)*8)(3) @@ -103,14 +103,14 @@ JUMPTARGET(GLUE(__sigsetjmp,_ent)): std r31,((JB_GPRS+17)*8)(3) stfd fp31,((JB_FPRS+17)*8)(3) #ifndef __NO_VMX__ - ld r5,.LC__dl_hwcap@toc(r2) + ld r6,.LC__dl_hwcap@toc(r2) # ifdef SHARED /* Load _rtld-global._dl_hwcap. */ - ld r5,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r5) + ld r6,RTLD_GLOBAL_RO_DL_HWCAP_OFFSET(r6) # else - ld r5,0(r5) /* Load extern _dl_hwcap. */ + ld r6,0(r6) /* Load extern _dl_hwcap. */ # endif - andis. r5,r5,(PPC_FEATURE_HAS_ALTIVEC >> 16) + andis. r6,r6,(PPC_FEATURE_HAS_ALTIVEC >> 16) beq L(no_vmx) la r5,((JB_VRS)*8)(3) andi. r6,r5,0xf @@ -185,6 +185,8 @@ L(aligned_save_vmx): stvx 30,0,r5 stvx 31,0,r6 L(no_vmx): +#else + li r6,0 #endif #if defined NOT_IN_libc && defined IS_IN_rtld li r3,0 diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h index 0d231912ba..470da5aa6e 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/sysdep.h @@ -283,9 +283,10 @@ # define PTR_MANGLE(reg, tmpreg) \ lwz tmpreg,POINTER_GUARD(r2); \ xor reg,tmpreg,reg -# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) -# define PTR_DEMANGLE2(reg, tmpreg) \ +# define PTR_MANGLE2(reg, tmpreg) \ xor reg,tmpreg,reg +# define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) +# define PTR_DEMANGLE2(reg, tmpreg) PTR_MANGLE2 (reg, tmpreg) # else # define PTR_MANGLE(var) \ (var) = (__typeof (var)) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ()) diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h index e0b4cb3eed..858b5c4757 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep.h @@ -297,7 +297,10 @@ # define PTR_MANGLE(reg, tmpreg) \ ld tmpreg,POINTER_GUARD(r13); \ xor reg,tmpreg,reg +# define PTR_MANGLE2(reg, tmpreg) \ + xor reg,tmpreg,reg # define PTR_DEMANGLE(reg, tmpreg) PTR_MANGLE (reg, tmpreg) +# define PTR_DEMANGLE2(reg, tmpreg) PTR_MANGLE2 (reg, tmpreg) # else # define PTR_MANGLE(var) \ (var) = (void *) ((uintptr_t) (var) ^ THREAD_GET_POINTER_GUARD ())