User talk:Kevo12: Difference between revisions

From Star Wars Combine :: Game Guide
Jump to navigation Jump to search
Kevo12 (talk | contribs)
Kevo12 (talk | contribs)
Blanked the page
 
(188 intermediate revisions by 2 users not shown)
Line 1: Line 1:
build-shared and build-static successful for i686.


No binary differences.
OK?
2000-06-29  Greg McGary  <greg@mcgary.org>
* 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.
Index: sysdeps/i386/__longjmp.S
===================================================================
===================================================================
===================================================================
===================================================================
===================================================================
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/i386/bits/setjmp.h,v
retrieving revision 1.4
diff -u -p -r1.4 setjmp.h
--- setjmp.h 1998/04/22 09:27:22 1.4
+++ setjmp.h 2000/06/29 22:38:49
@@ -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
Index: sysdeps/i386/elf/setjmp.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/i386/elf/setjmp.S,v
retrieving revision 1.4
diff -u -p -r1.4 setjmp.S
--- setjmp.S 2000/06/09 06:14:39 1.4
+++ setjmp.S 2000/06/29 22:38:49
@@ -21,50 +21,49 @@
#define _ASM
#define _SETJMP_H
#include <bits/setjmp.h>
+#include "bp-sym.h"
#include "bp-asm.h"
-#define PARMS LINKAGE /* no space for saved regs */
-#define JBUF PARMS
-#define SGMSK JBUF+PRT_SIZE
-
/* We include the BSD entry points here as well but we make
  them weak.  */
-ENTRY (setjmp)
- .weak C_SYMBOL_NAME (setjmp)
- popl %eax /* Pop return PC.  */
- popl %ecx /* Pop jmp_buf argument.  */
- pushl $1 /* Push second argument of zero.  */
- pushl %ecx /* Push back first argument.  */
- pushl %eax /* Push back return PC.  */
+ENTRY (BP_SYM (setjmp))
+ .weak C_SYMBOL_NAME (BP_SYM (setjmp))
+ PUSH_SIGNAL_MASK (1)
/* Note that we have to use a non-exported symbol in the next
  jump since otherwise gas will emit it as a jump through the
  PLT which is what we cannot use here.  */
jmp .Linternal_sigsetjmp
-END (setjmp)
+END (BP_SYM (setjmp))
/* Binary compatibility entry point.  */
-ENTRY (_setjmp)
- .weak C_SYMBOL_NAME (_setjmp)
-ENTRY (__setjmp)
- popl %eax /* Pop return address.  */
- popl %ecx /* Pop jmp_buf.  */
- pushl $0 /* Push zero argument.  */
- pushl %ecx /* Push jmp_buf.  */
- pushl %eax /* Push back return address.  */
-
-ENTRY (__sigsetjmp)
-.Linternal_sigsetjmp = __sigsetjmp
- movl 4(%esp), %eax /* User's jmp_buf in %eax.  */
+ENTRY (BP_SYM (_setjmp))
+ .weak C_SYMBOL_NAME (BP_SYM (_setjmp))
+ENTRY (BP_SYM (__setjmp))
+ PUSH_SIGNAL_MASK (0)
+ /* FALL THROUGH */
+
+#define PARMS LINKAGE /* no space for saved regs */
+#define JMPBUF PARMS
+#define SIGMSK JMPBUF+PTR_SIZE
+
+ENTRY (BP_SYM (__sigsetjmp))
+.Linternal_sigsetjmp = BP_SYM (__sigsetjmp)
+ ENTER
+
+ movl JMPBUF(%esp), %eax
+ CHECK_BOUNDS_BOTH_WIDE (%eax, JMPBUF(%esp), $JB_SIZE)
+
      /* Save registers.  */
movl %ebx, (JB_BX*4)(%eax)
movl %esi, (JB_SI*4)(%eax)
movl %edi, (JB_DI*4)(%eax)
movl %ebp, (JB_BP*4)(%eax)
- leal JBUF(%esp), %ecx /* Save SP as it will be after we return.  */
+ leal JMPBUF(%esp), %ecx /* Save SP as it will be after we return.  */
      movl %ecx, (JB_SP*4)(%eax)
- movl 0(%esp), %ecx /* Save PC we are returning to now.  */
+ movl PCOFF(%esp), %ecx /* Save PC we are returning to now.  */
      movl %ecx, (JB_PC*4)(%eax)
+ LEAVE /* pop frame pointer to prepare for tail-call.  */
/* Make a tail call to __sigjmp_save; it takes the same args.  */
#ifdef PIC
/* We cannot use the PLT, because it requires that %ebx be set, but
@@ -74,9 +73,9 @@ ENTRY (__sigsetjmp)
call here
here: popl %ecx
addl $_GLOBAL_OFFSET_TABLE_+[.-here], %ecx
- movl C_SYMBOL_NAME(__sigjmp_save@GOT)(%ecx), %ecx
+ movl C_SYMBOL_NAME (BP_SYM (__sigjmp_save)@GOT)(%ecx), %ecx
jmp *%ecx
#else
- jmp __sigjmp_save
+ jmp BP_SYM (__sigjmp_save)
#endif
-END (__sigsetjmp)
+END (BP_SYM (__sigsetjmp))
--------------------------------------------------------------------------------
Follow-Ups:
Re: PATCH: BPs for ix86 setjmp/longjmp
From: Ulrich Drepper
Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index] 
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Latest revision as of 17:29, 19 March 2012