summaryrefslogtreecommitdiff
path: root/sysdeps/i386
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2006-01-02 10:52:59 +0000
committerJakub Jelinek <jakub@redhat.com>2006-01-02 10:52:59 +0000
commit0db2497936950725ae71e997091ef276a3ec43ee (patch)
tree7d66db137accea00fe402dfabf8e5de3a4af58c6 /sysdeps/i386
parentb9ea6c38033d6ab0bda9dddb34cc7a4c6ff82084 (diff)
Updated to fedora-glibc-20060102T1045
Diffstat (limited to 'sysdeps/i386')
-rw-r--r--sysdeps/i386/__longjmp.S32
-rw-r--r--sysdeps/i386/bits/setjmp.h6
-rw-r--r--sysdeps/i386/bsd-_setjmp.S3
-rw-r--r--sysdeps/i386/bsd-setjmp.S3
-rw-r--r--sysdeps/i386/setjmp.S3
5 files changed, 42 insertions, 5 deletions
diff --git a/sysdeps/i386/__longjmp.S b/sysdeps/i386/__longjmp.S
index aced5f42c9..10a4650fb0 100644
--- a/sysdeps/i386/__longjmp.S
+++ b/sysdeps/i386/__longjmp.S
@@ -32,6 +32,36 @@
ENTRY (BP_SYM (__longjmp))
ENTER
+#ifdef PTR_DEMANGLE
+ movl JBUF(%esp), %eax /* User's jmp_buf in %eax. */
+ CHECK_BOUNDS_BOTH_WIDE (%eax, JBUF(%esp), $JB_SIZE)
+
+ /* Save the return address now. */
+ movl (JB_PC*4)(%eax), %edx
+ /* Get the stack pointer. */
+ movl (JB_SP*4)(%eax), %ecx
+ PTR_DEMANGLE (%edx)
+ PTR_DEMANGLE (%ecx)
+ cfi_def_cfa(%eax, 0)
+ cfi_register(%eip, %edx)
+ cfi_register(%esp, %ecx)
+ cfi_offset(%ebx, JB_BX*4)
+ cfi_offset(%esi, JB_SI*4)
+ cfi_offset(%edi, JB_DI*4)
+ cfi_offset(%ebp, JB_BP*4)
+ /* Restore registers. */
+ movl (JB_BX*4)(%eax), %ebx
+ movl (JB_SI*4)(%eax), %esi
+ movl (JB_DI*4)(%eax), %edi
+ movl (JB_BP*4)(%eax), %ebp
+ cfi_restore(%ebx)
+ cfi_restore(%esi)
+ cfi_restore(%edi)
+ cfi_restore(%ebp)
+
+ movl VAL(%esp), %eax /* Second argument is return value. */
+ movl %ecx, %esp
+#else
movl JBUF(%esp), %ecx /* User's jmp_buf in %ecx. */
CHECK_BOUNDS_BOTH_WIDE (%ecx, JBUF(%esp), $JB_SIZE)
@@ -44,8 +74,6 @@ ENTRY (BP_SYM (__longjmp))
movl (JB_DI*4)(%ecx), %edi
movl (JB_BP*4)(%ecx), %ebp
movl (JB_SP*4)(%ecx), %esp
-#ifdef PTR_DEMANGLE
- PTR_DEMANGLE (%edx)
#endif
/* Jump to saved PC. */
jmp *%edx
diff --git a/sysdeps/i386/bits/setjmp.h b/sysdeps/i386/bits/setjmp.h
index 107fe58b35..d99a726ba3 100644
--- a/sysdeps/i386/bits/setjmp.h
+++ b/sysdeps/i386/bits/setjmp.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000, 2001, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2001, 2003, 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
@@ -40,7 +40,7 @@ typedef int __jmp_buf[6];
/* Test if longjmp to JMPBUF would unwind the frame
containing a local variable at ADDRESS. */
-#define _JMPBUF_UNWINDS(jmpbuf, address) \
- ((void *) (address) < (void *) (jmpbuf)[JB_SP])
+#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
+ ((void *) (address) < (void *) demangle ((jmpbuf)[JB_SP]))
#endif /* bits/setjmp.h */
diff --git a/sysdeps/i386/bsd-_setjmp.S b/sysdeps/i386/bsd-_setjmp.S
index f80d239323..99cc79160a 100644
--- a/sysdeps/i386/bsd-_setjmp.S
+++ b/sysdeps/i386/bsd-_setjmp.S
@@ -44,6 +44,9 @@ ENTRY (BP_SYM (_setjmp))
movl %esi, (JB_SI*4)(%edx)
movl %edi, (JB_DI*4)(%edx)
leal JMPBUF(%esp), %ecx /* Save SP as it will be after we return. */
+#ifdef PTR_MANGLE
+ PTR_MANGLE (%ecx)
+#endif
movl %ecx, (JB_SP*4)(%edx)
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
#ifdef PTR_MANGLE
diff --git a/sysdeps/i386/bsd-setjmp.S b/sysdeps/i386/bsd-setjmp.S
index f4257a0dc5..02c76a8c79 100644
--- a/sysdeps/i386/bsd-setjmp.S
+++ b/sysdeps/i386/bsd-setjmp.S
@@ -46,6 +46,9 @@ ENTRY (BP_SYM (setjmp))
movl %esi, (JB_SI*4)(%eax)
movl %edi, (JB_DI*4)(%eax)
leal JMPBUF(%esp), %ecx /* Save SP as it will be after we return. */
+#ifdef PTR_MANGLE
+ PTR_MANGLE (%ecx)
+#endif
movl %ecx, (JB_SP*4)(%eax)
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
#ifdef PTR_MANGLE
diff --git a/sysdeps/i386/setjmp.S b/sysdeps/i386/setjmp.S
index 747499adc2..94dcbf2e1f 100644
--- a/sysdeps/i386/setjmp.S
+++ b/sysdeps/i386/setjmp.S
@@ -40,6 +40,9 @@ ENTRY (BP_SYM (__sigsetjmp))
movl %esi, (JB_SI*4)(%eax)
movl %edi, (JB_DI*4)(%eax)
leal JMPBUF(%esp), %ecx /* Save SP as it will be after we return. */
+#ifdef PTR_MANGLE
+ PTR_MANGLE (%ecx)
+#endif
movl %ecx, (JB_SP*4)(%eax)
movl PCOFF(%esp), %ecx /* Save PC we are returning to now. */
#ifdef PTR_MANGLE