diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2015-09-13 07:36:59 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2015-09-13 07:36:59 +0000 |
commit | acd27e3126009714e62b716d2352d7c439d37219 (patch) | |
tree | cdf95a2d876a298bfde0fbab66c532b1fd99d945 | |
parent | 935fadcb6d65619c7e89e38170798865f6d7f187 (diff) |
Do provide hidden _libc_* aliases for sig{block,setmask} and use them in
the ASM *setjmp implementations.
Skip the PLT when calling them on amd64 (other archs to do this after testing)
ok miod@
-rw-r--r-- | lib/libc/arch/alpha/gen/setjmp.S | 4 | ||||
-rw-r--r-- | lib/libc/arch/amd64/gen/setjmp.S | 14 | ||||
-rw-r--r-- | lib/libc/arch/amd64/gen/sigsetjmp.S | 14 | ||||
-rw-r--r-- | lib/libc/arch/arm/gen/setjmp.S | 6 | ||||
-rw-r--r-- | lib/libc/arch/hppa/gen/setjmp.S | 6 | ||||
-rw-r--r-- | lib/libc/arch/hppa64/gen/setjmp.S | 6 | ||||
-rw-r--r-- | lib/libc/arch/i386/gen/setjmp.S | 10 | ||||
-rw-r--r-- | lib/libc/arch/i386/gen/sigsetjmp.S | 10 | ||||
-rw-r--r-- | lib/libc/arch/m88k/gen/setjmp.S | 10 | ||||
-rw-r--r-- | lib/libc/arch/m88k/gen/sigsetjmp.S | 10 | ||||
-rw-r--r-- | lib/libc/arch/mips64/gen/setjmp.S | 4 | ||||
-rw-r--r-- | lib/libc/arch/powerpc/gen/setjmp.S | 10 | ||||
-rw-r--r-- | lib/libc/arch/vax/gen/setjmp.S | 4 | ||||
-rw-r--r-- | lib/libc/compat-43/sigcompat.c | 2 | ||||
-rw-r--r-- | lib/libc/hidden/signal.h | 6 |
15 files changed, 51 insertions, 65 deletions
diff --git a/lib/libc/arch/alpha/gen/setjmp.S b/lib/libc/arch/alpha/gen/setjmp.S index ab3807f4858..95ce4dfdeba 100644 --- a/lib/libc/arch/alpha/gen/setjmp.S +++ b/lib/libc/arch/alpha/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.7 2005/08/07 16:40:13 espie Exp $ */ +/* $OpenBSD: setjmp.S,v 1.8 2015/09/13 07:36:58 guenther Exp $ */ /* $NetBSD: setjmp.S,v 1.2 1996/10/17 03:08:06 cgd Exp $ */ /* @@ -63,7 +63,7 @@ LEAF(setjmp, 1) /* see what's blocked */ mov zero, a0 - CALL(sigblock) /* see what's blocked */ + CALL(_libc_sigblock) /* see what's blocked */ stq v0, (1 * 8)(s0) /* and remember it in sc_mask */ lda sp, -24(sp) /* padded struct sigaltstack */ diff --git a/lib/libc/arch/amd64/gen/setjmp.S b/lib/libc/arch/amd64/gen/setjmp.S index 4a2914d6283..afb9845c0c7 100644 --- a/lib/libc/arch/amd64/gen/setjmp.S +++ b/lib/libc/arch/amd64/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.4 2015/05/29 08:50:12 uebayasi Exp $ */ +/* $OpenBSD: setjmp.S,v 1.5 2015/09/13 07:36:58 guenther Exp $ */ /* $NetBSD: __setjmp14.S,v 1.1 2001/06/19 00:25:02 fvdl Exp $ */ /* @@ -53,11 +53,7 @@ ENTRY(setjmp) pushq %rdi xorq %rdi,%rdi -#ifdef __PIC__ - call PIC_PLT(_C_LABEL(sigblock)) -#else - call _C_LABEL(sigblock) -#endif + call _C_LABEL(_libc_sigblock) popq %rdi movq %rax,(_JB_SIGMASK * 8)(%rdi) @@ -81,11 +77,7 @@ ENTRY(longjmp) movq (_JB_SIGMASK * 8)(%rdi),%rdi pushq %r8 -#ifdef __PIC__ - call PIC_PLT(_C_LABEL(sigsetmask)) -#else - call _C_LABEL(sigsetmask) -#endif + call _C_LABEL(_libc_sigsetmask) popq %r8 movq (_JB_RBX * 8)(%r12),%rbx movq (_JB_RBP * 8)(%r12),%rbp diff --git a/lib/libc/arch/amd64/gen/sigsetjmp.S b/lib/libc/arch/amd64/gen/sigsetjmp.S index b236134b20f..58a7df7958d 100644 --- a/lib/libc/arch/amd64/gen/sigsetjmp.S +++ b/lib/libc/arch/amd64/gen/sigsetjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sigsetjmp.S,v 1.4 2015/05/29 08:50:12 uebayasi Exp $ */ +/* $OpenBSD: sigsetjmp.S,v 1.5 2015/09/13 07:36:58 guenther Exp $ */ /* $NetBSD: __setjmp14.S,v 1.1 2001/06/19 00:25:02 fvdl Exp $ */ /* @@ -57,11 +57,7 @@ ENTRY(sigsetjmp) pushq %rdi xorq %rdi,%rdi -#ifdef __PIC__ - call PIC_PLT(_C_LABEL(sigblock)) -#else - call _C_LABEL(sigblock) -#endif + call _C_LABEL(_libc_sigblock) popq %rdi movq %rax,(_JB_SIGMASK * 8)(%rdi) @@ -86,11 +82,7 @@ ENTRY(siglongjmp) jz 2f movq (_JB_SIGMASK * 8)(%rdi),%rdi -#ifdef __PIC__ - call PIC_PLT(_C_LABEL(sigsetmask)) -#else - call _C_LABEL(sigsetmask) -#endif + call _C_LABEL(_libc_sigsetmask) 2: popq %rax movq (_JB_RBX * 8)(%r12),%rbx movq (_JB_RBP * 8)(%r12),%rbp diff --git a/lib/libc/arch/arm/gen/setjmp.S b/lib/libc/arch/arm/gen/setjmp.S index b82db669f97..d63012b7705 100644 --- a/lib/libc/arch/arm/gen/setjmp.S +++ b/lib/libc/arch/arm/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.2 2004/02/01 05:40:52 drahn Exp $ */ +/* $OpenBSD: setjmp.S,v 1.3 2015/09/13 07:36:58 guenther Exp $ */ /* $NetBSD: setjmp.S,v 1.5 2003/04/05 23:08:51 bjh21 Exp $ */ /* @@ -51,7 +51,7 @@ ENTRY(setjmp) stmfd sp!, {r0, r14} mov r0, #0x00000000 - bl PIC_SYM(_C_LABEL(sigblock), PLT) + bl PIC_SYM(_C_LABEL(_libc_sigblock), PLT) mov r1, r0 ldmfd sp!, {r0, r14} @@ -94,7 +94,7 @@ ENTRY(longjmp) sub sp, sp, #4 /* align the stack */ mov r0, r2 - bl PIC_SYM(_C_LABEL(sigsetmask), PLT) + bl PIC_SYM(_C_LABEL(_libc_sigsetmask), PLT) add sp, sp, #4 /* unalign the stack */ ldmfd sp!, {r0, r1, r14} diff --git a/lib/libc/arch/hppa/gen/setjmp.S b/lib/libc/arch/hppa/gen/setjmp.S index 44077a9c1a5..c1007e24cf9 100644 --- a/lib/libc/arch/hppa/gen/setjmp.S +++ b/lib/libc/arch/hppa/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.8 2011/04/15 21:39:45 ariane Exp $ */ +/* $OpenBSD: setjmp.S,v 1.9 2015/09/13 07:36:58 guenther Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -64,7 +64,7 @@ ALTENTRY(setjmp) copy %sp, %r3 stw,ma %r1, HPPA_FRAME_SIZE(%sp) - bl sigblock, %rp + bl _libc_sigblock, %rp copy %r0, %arg0 ldo HPPA_FRAME_SIZE(%r3), %sp @@ -139,7 +139,7 @@ ALTENTRY(longjmp) copy %sp, %r3 stw,ma %r1, HPPA_FRAME_SIZE(%sp) - bl sigsetmask, %rp + bl _libc_sigsetmask, %rp ldw 4(%arg0), %arg0 ldo HPPA_FRAME_SIZE(%r3), %sp diff --git a/lib/libc/arch/hppa64/gen/setjmp.S b/lib/libc/arch/hppa64/gen/setjmp.S index c5c21fb33d0..27e4ef23b9c 100644 --- a/lib/libc/arch/hppa64/gen/setjmp.S +++ b/lib/libc/arch/hppa64/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.3 2011/04/21 14:02:42 jsing Exp $ */ +/* $OpenBSD: setjmp.S,v 1.4 2015/09/13 07:36:58 guenther Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -64,7 +64,7 @@ ALTENTRY(setjmp) copy %sp, %r3 std,ma %r1, HPPA_FRAME_SIZE(%sp) - bl sigblock, %rp + bl _libc_sigblock, %rp copy %r0, %arg0 ldo HPPA_FRAME_SIZE(%r3), %sp @@ -145,7 +145,7 @@ ALTENTRY(longjmp) copy %sp, %r3 std,ma %r1, HPPA_FRAME_SIZE(%sp) - bl sigsetmask, %rp + bl _libc_sigsetmask, %rp ldd 8(%arg0), %arg0 ldo HPPA_FRAME_SIZE(%r3), %sp diff --git a/lib/libc/arch/i386/gen/setjmp.S b/lib/libc/arch/i386/gen/setjmp.S index 0c09e321610..4f183b2658c 100644 --- a/lib/libc/arch/i386/gen/setjmp.S +++ b/lib/libc/arch/i386/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.9 2012/08/22 17:19:34 pascal Exp $ */ +/* $OpenBSD: setjmp.S,v 1.10 2015/09/13 07:36:58 guenther Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -47,9 +47,9 @@ ENTRY(setjmp) PIC_PROLOGUE pushl $0 #ifdef __PIC__ - call PIC_PLT(_C_LABEL(sigblock)) + call PIC_PLT(_C_LABEL(_libc_sigblock)) #else - call _C_LABEL(sigblock) + call _C_LABEL(_libc_sigblock) #endif addl $4,%esp PIC_EPILOGUE @@ -71,9 +71,9 @@ ENTRY(longjmp) PIC_PROLOGUE pushl 24(%edx) #ifdef __PIC__ - call PIC_PLT(_C_LABEL(sigsetmask)) + call PIC_PLT(_C_LABEL(_libc_sigsetmask)) #else - call _C_LABEL(sigsetmask) + call _C_LABEL(_libc_sigsetmask) #endif addl $4,%esp PIC_EPILOGUE diff --git a/lib/libc/arch/i386/gen/sigsetjmp.S b/lib/libc/arch/i386/gen/sigsetjmp.S index 33215b13b33..43a7e2b6a35 100644 --- a/lib/libc/arch/i386/gen/sigsetjmp.S +++ b/lib/libc/arch/i386/gen/sigsetjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sigsetjmp.S,v 1.8 2012/08/22 17:19:34 pascal Exp $ */ +/* $OpenBSD: sigsetjmp.S,v 1.9 2015/09/13 07:36:58 guenther Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -43,9 +43,9 @@ ENTRY(sigsetjmp) PIC_PROLOGUE pushl $0 #ifdef __PIC__ - call PIC_PLT(_C_LABEL(sigblock)) + call PIC_PLT(_C_LABEL(_libc_sigblock)) #else - call _C_LABEL(sigblock) + call _C_LABEL(_libc_sigblock) #endif addl $4,%esp PIC_EPILOGUE @@ -70,9 +70,9 @@ ENTRY(siglongjmp) PIC_PROLOGUE pushl 24(%edx) #ifdef __PIC__ - call PIC_PLT(_C_LABEL(sigsetmask)) + call PIC_PLT(_C_LABEL(_libc_sigsetmask)) #else - call _C_LABEL(sigsetmask) + call _C_LABEL(_libc_sigsetmask) #endif addl $4,%esp PIC_EPILOGUE diff --git a/lib/libc/arch/m88k/gen/setjmp.S b/lib/libc/arch/m88k/gen/setjmp.S index 41c152e80e8..60a0309859a 100644 --- a/lib/libc/arch/m88k/gen/setjmp.S +++ b/lib/libc/arch/m88k/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.13 2013/01/20 17:59:52 miod Exp $ */ +/* $OpenBSD: setjmp.S,v 1.14 2015/09/13 07:36:58 guenther Exp $ */ /*- * Copyright (c) 2002 Steve Murphree, Jr. * All rights reserved. @@ -77,9 +77,9 @@ ENTRY(setjmp) st %r4,%r2,80 /* setjmp type to _setjmp */ or %r14,%r2,0 /* store address of env in r14 */ #ifdef __PIC__ - bsr.n _C_LABEL(sigblock)#plt /* r2 = sigblock(0) */ + bsr.n _C_LABEL(_libc_sigblock)#plt /* r2 = sigblock(0) */ #else - bsr.n _C_LABEL(sigblock) /* r2 = sigblock(0) */ + bsr.n _C_LABEL(_libc_sigblock) /* r2 = sigblock(0) */ #endif or %r2,%r0,0 st %r2,%r14,4 /* save signal set in offset 4 of env */ @@ -120,9 +120,9 @@ ENTRY(longjmp) subu %r31,%r31,16 /* get a temporary stack */ st.d %r2,%r31,0 /* save r2 and r3 on stack (env + return val) */ #ifdef __PIC__ - bsr.n _C_LABEL(sigsetmask)#plt /* restore the signal set */ + bsr.n _C_LABEL(_libc_sigsetmask)#plt /* restore the signal set */ #else - bsr.n _C_LABEL(sigsetmask) /* restore the signal set */ + bsr.n _C_LABEL(_libc_sigsetmask) /* restore the signal set */ #endif ld %r2,%r2,4 ld.d %r2,%r31,0 /* restore r2 and r3 */ diff --git a/lib/libc/arch/m88k/gen/sigsetjmp.S b/lib/libc/arch/m88k/gen/sigsetjmp.S index fa199466343..342b79e5e55 100644 --- a/lib/libc/arch/m88k/gen/sigsetjmp.S +++ b/lib/libc/arch/m88k/gen/sigsetjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: sigsetjmp.S,v 1.14 2013/01/20 17:59:52 miod Exp $ */ +/* $OpenBSD: sigsetjmp.S,v 1.15 2015/09/13 07:36:58 guenther Exp $ */ /*- * Copyright (c) 2002 Steve Murphree, Jr. * All rights reserved. @@ -81,9 +81,9 @@ ENTRY(sigsetjmp) st %r3,%r2,84 /* save `savemask' value */ or %r14,%r2,0 /* store address of env in r14 */ #ifdef __PIC__ - bsr.n _C_LABEL(sigblock)#plt /* r2 = sigblock(0) */ + bsr.n _C_LABEL(_libc_sigblock)#plt /* r2 = sigblock(0) */ #else - bsr.n _C_LABEL(sigblock) /* r2 = sigblock(0) */ + bsr.n _C_LABEL(_libc_sigblock) /* r2 = sigblock(0) */ #endif or %r2,%r0,%r0 st %r2,%r14,4 /* save signal set in offset 4 of env */ @@ -127,9 +127,9 @@ ENTRY(siglongjmp) subu %r31,%r31,16 /* get a temporary stack */ st.d %r2,%r31,0 /* save r2 and r3 on stack (env + return val) */ #ifdef __PIC__ - bsr.n _C_LABEL(sigsetmask)#plt /* restore the signal set */ + bsr.n _C_LABEL(_libc_sigsetmask)#plt /* restore the signal set */ #else - bsr.n _C_LABEL(sigsetmask) /* restore the signal set */ + bsr.n _C_LABEL(_libc_sigsetmask) /* restore the signal set */ #endif ld %r2,%r2,4 ld.d %r2,%r31,0 /* restore r2 and r3 from stack */ diff --git a/lib/libc/arch/mips64/gen/setjmp.S b/lib/libc/arch/mips64/gen/setjmp.S index 156c25046da..2d361fb6b59 100644 --- a/lib/libc/arch/mips64/gen/setjmp.S +++ b/lib/libc/arch/mips64/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.7 2011/11/22 21:13:30 guenther Exp $ */ +/* $OpenBSD: setjmp.S,v 1.8 2015/09/13 07:36:58 guenther Exp $ */ /* * Copyright (c) 2001-2002 Opsycon AB (www.opsycon.se / www.opsycon.com) @@ -54,7 +54,7 @@ NON_LEAF(setjmp, FRAMESZ, ra) REG_S a0, A0OFF(sp) move a0, zero # get current signal mask - jal sigblock + jal _libc_sigblock REG_L v1, A0OFF(sp) # v1 = jmpbuf REG_S v0, SC_MASK(v1) # save sc_mask = sigblock(0) diff --git a/lib/libc/arch/powerpc/gen/setjmp.S b/lib/libc/arch/powerpc/gen/setjmp.S index 3a4e532623c..bbbe854e23d 100644 --- a/lib/libc/arch/powerpc/gen/setjmp.S +++ b/lib/libc/arch/powerpc/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.7 2015/08/23 15:42:01 kettenis Exp $ */ +/* $OpenBSD: setjmp.S,v 1.8 2015/09/13 07:36:58 guenther Exp $ */ /* * Copyright (c) 1996 Dale Rahn. All rights reserved. * @@ -55,7 +55,7 @@ #define JMP_sig 0x60 -.extern sigblock +.extern _libc_sigblock ENTRY(setjmp) /* r31, mask */ @@ -71,7 +71,7 @@ ENTRY(setjmp) #endif mr 31, 3 li 3, 0 - bl PIC_PLT(sigblock) + bl PIC_PLT(_libc_sigblock) stw 3, JMP_sig(31) /* should sigaltstack be checked and saved */ mr 3, 31 @@ -116,7 +116,7 @@ ENTRY(_setjmp) blr -.extern sigsetmask +.extern _libc_sigsetmask ENTRY(longjmp) /* r31, mask */ mr 29, 3 @@ -130,7 +130,7 @@ ENTRY(longjmp) mtlr 0 #endif lwz 3, JMP_sig(3) - bl PIC_PLT(sigsetmask) + bl PIC_PLT(_libc_sigsetmask) /* should we deal with sigonstack here ?? */ mr 4, 31 mr 3, 29 diff --git a/lib/libc/arch/vax/gen/setjmp.S b/lib/libc/arch/vax/gen/setjmp.S index e390c1d07cd..d44108dd4af 100644 --- a/lib/libc/arch/vax/gen/setjmp.S +++ b/lib/libc/arch/vax/gen/setjmp.S @@ -1,4 +1,4 @@ -/* $OpenBSD: setjmp.S,v 1.9 2013/07/05 21:10:50 miod Exp $ */ +/* $OpenBSD: setjmp.S,v 1.10 2015/09/13 07:36:58 guenther Exp $ */ /* * Copyright (c) 1983, 1993 * The Regents of the University of California. All rights reserved. @@ -49,7 +49,7 @@ ENTRY(setjmp, R6) calls $4,_C_LABEL(sigaltstack)# pop args plus signal stack value movl (%sp)+,(%r6)+ # save onsigstack status of caller pushl $0 - calls $1,_C_LABEL(sigblock) # get signal mask + calls $1,_C_LABEL(_libc_sigblock) # get signal mask movl %r0,(%r6)+ # save signal mask of caller movl (%ap),%r0 moval 4(%ap)[%r0],(%r6)+ # save sp of caller diff --git a/lib/libc/compat-43/sigcompat.c b/lib/libc/compat-43/sigcompat.c index 2698dcadd87..4e82ef5bd35 100644 --- a/lib/libc/compat-43/sigcompat.c +++ b/lib/libc/compat-43/sigcompat.c @@ -56,6 +56,7 @@ sigsetmask(int mask) return (n); return (omask); } +DEF_WEAK(sigsetmask); int sigblock(int mask) @@ -67,6 +68,7 @@ sigblock(int mask) return (n); return (omask); } +DEF_WEAK(sigblock); int sigpause(int mask) diff --git a/lib/libc/hidden/signal.h b/lib/libc/hidden/signal.h index 725d03e136e..78222d449cf 100644 --- a/lib/libc/hidden/signal.h +++ b/lib/libc/hidden/signal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: signal.h,v 1.5 2015/09/12 16:46:12 guenther Exp $ */ +/* $OpenBSD: signal.h,v 1.6 2015/09/13 07:36:58 guenther Exp $ */ /* * Copyright (c) 2015 Philip Guenther <guenther@openbsd.org> * @@ -36,7 +36,7 @@ PROTO_NORMAL(raise); /*PROTO_WRAP(sigaction); wrap to hide SIGTHR */ PROTO_NORMAL(sigaddset); PROTO_NORMAL(sigaltstack); -PROTO_DEPRECATED(sigblock); +PROTO_NORMAL(sigblock); PROTO_NORMAL(sigdelset); PROTO_NORMAL(sigemptyset); PROTO_NORMAL(sigfillset); @@ -47,7 +47,7 @@ PROTO_DEPRECATED(sigpause); /*PROTO_NORMAL(sigpending); wrap to hide SIGTHR */ /*PROTO_WRAP(sigprocmask); wrap to hide SIGTHR */ PROTO_NORMAL(sigreturn); -PROTO_DEPRECATED(sigsetmask); +PROTO_NORMAL(sigsetmask); /*PROTO_CANCEL(sigsuspend); wrap to hide SIGTHR */ PROTO_DEPRECATED(sigvec); |