From e5f88e0ca0d2762ca87263ee01d13e9950de403d Mon Sep 17 00:00:00 2001 From: Greg McGary Date: Thu, 29 Jun 2000 22:55:31 +0000 Subject: * sysdeps/i386/bp-asm.h (PCOFF): New constant. (POP_ERRNO_LOCATION_RETURN): Fold insns. * sysdeps/i386/bits/setjmp.h (JB_SIZE): New constant. (PUSH_SIGNAL_MASK): New macro. * sysdeps/i386/__longjmp.S (__longjmp): Wrap symbol in BP_SYM (). LEAVE is unnecessary. Check bounds of jmp_buf. * sysdeps/i386/elf/setjmp.S: Call PUSH_SIGNAL_MASK. Wrap symbols in BP_SYM (). Check bounds of jmp_buf. Don't call LEAVE until immediately before tail-call. * sysdeps/i386/setjmp.S: Likewise. * sysdeps/i386/bsd-_setjmp.S: Likewise. * sysdeps/i386/bsd-setjmp.S: Likewise. 2000-06-29 Greg McGary * sysdeps/i386/bp-asm.h (PCOFF): New constant. (POP_ERRNO_LOCATION_RETURN): Fold insns. * sysdeps/i386/bits/setjmp.h (JB_SIZE): New constant. (PUSH_SIGNAL_MASK): New macro. * sysdeps/i386/__longjmp.S (__longjmp): Wrap symbol in BP_SYM (). LEAVE is unnecessary. Check bounds of jmp_buf. * sysdeps/i386/elf/setjmp.S: Call PUSH_SIGNAL_MASK. Wrap symbols in BP_SYM (). Check bounds of jmp_buf. Don't call LEAVE until immediately before tail-call. * sysdeps/i386/setjmp.S: Likewise. * sysdeps/i386/bsd-_setjmp.S: Likewise. * sysdeps/i386/bsd-setjmp.S: Likewise. --- sysdeps/i386/bits/setjmp.h | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'sysdeps/i386/bits/setjmp.h') diff --git a/sysdeps/i386/bits/setjmp.h b/sysdeps/i386/bits/setjmp.h index 2f5b44531a..327e5670ac 100644 --- a/sysdeps/i386/bits/setjmp.h +++ b/sysdeps/i386/bits/setjmp.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1997, 1998 Free Software Foundation, Inc. +/* Copyright (C) 1997, 1998, 2000 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 @@ -29,9 +29,31 @@ # define JB_BP 3 # define JB_SP 4 # define JB_PC 5 +# define JB_SIZE 24 #endif -#ifndef _ASM +#ifdef _ASM +/* We internally convert all setjmp (buf) calls to sigsetjmp (buf, mask), + so we must shift with the call frame to insert the mask argument. */ +# if __BOUNDED_POINTERS__ +# define PUSH_SIGNAL_MASK(MASK) \ + popl %eax; /* return address */ \ + popl %ecx; /* jmp_buf value */ \ + popl %edx; /* jmp_buf low bound */ \ + pushl 0(%esp); /* jmp_buf high bound */ \ + movel $MASK, 4(%esp); \ + pushl %edx; \ + pushl %ecx; \ + pushl %eax +# else +# define PUSH_SIGNAL_MASK(MASK) \ + popl %eax; /* return address */ \ + popl %ecx; /* jmp_buf */ \ + pushl $MASK; \ + pushl %ecx; \ + pushl %eax +# endif +#else typedef int __jmp_buf[6]; #endif -- cgit v1.2.3