This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/595] x86 syscall stubs are missing unwind info
- From: "davidm at hpl dot hp dot com" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 1 Dec 2004 05:41:51 -0000
- Subject: [Bug libc/595] x86 syscall stubs are missing unwind info
- References: <20041201051933.595.davidm@hpl.hp.com>
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
------- Additional Comments From davidm at hpl dot hp dot com 2004-12-01 05:41 -------
(In reply to comment #0)
Hmmh, I can't seem to create an attachement, so I'll try to include the patch
below. Let's hope it doesn't get mangled.
--
Index: sysdeps/i386/sysdep.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/i386/sysdep.h,v
retrieving revision 1.14
diff -u -r1.14 sysdep.h
--- sysdeps/i386/sysdep.h 10 Mar 2003 09:10:46 -0000 1.14
+++ sysdeps/i386/sysdep.h 1 Dec 2004 02:58:40 -0000
@@ -57,10 +57,12 @@
.align ALIGNARG(4); \
STABS_FUN(name) \
C_LABEL(name) \
+ cfi_startproc; \
CALL_MCOUNT
#undef END
#define END(name) \
+ cfi_endproc; \
ASM_SIZE_DIRECTIVE(name) \
STABS_FUN_END(name)
@@ -91,8 +93,14 @@
#ifdef PROF
/* The mcount code relies on a normal frame pointer being on the stack
to locate our caller, so push one just for its benefit. */
-#define CALL_MCOUNT \
- pushl %ebp; movl %esp, %ebp; call JUMPTARGET(mcount); popl %ebp;
+#define CALL_MCOUNT \
+ pushl %ebp; \
+ cfi_adjust_cfa_offset(4); \
+ movl %esp, %ebp; \
+ cfi_def_cfa_register(%ebp); \
+ call JUMPTARGET(mcount); \
+ popl %ebp; \
+ cfi_def_cfa(esp,4);
#else
#define CALL_MCOUNT /* Do nothing. */
#endif
Index: sysdeps/unix/sysv/linux/i386/socket.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/socket.S,v
retrieving revision 1.19
diff -u -r1.19 socket.S
--- sysdeps/unix/sysv/linux/i386/socket.S 16 Jun 2003 23:06:41 -0000 1.19
+++ sysdeps/unix/sysv/linux/i386/socket.S 1 Dec 2004 02:58:44 -0000
@@ -41,7 +41,6 @@
#endif
.globl __socket
- cfi_startproc
ENTRY (__socket)
#if defined NEED_CANCELLATION && defined CENABLE
SINGLE_THREAD_P
@@ -118,7 +117,6 @@
/* Successful; return the syscall's value. */
ret
#endif
- cfi_endproc
PSEUDO_END (__socket)
#ifndef NO_WEAK_ALIAS
Index: sysdeps/unix/sysv/linux/i386/sysdep.h
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/sysdep.h,v
retrieving revision 1.57
diff -u -r1.57 sysdep.h
--- sysdeps/unix/sysv/linux/i386/sysdep.h 15 Oct 2004 21:30:34 -0000 1.57
+++ sysdeps/unix/sysv/linux/i386/sysdep.h 1 Dec 2004 02:58:44 -0000
@@ -160,16 +160,20 @@
# else
# define SYSCALL_ERROR_HANDLER \
0:pushl %ebx; \
+ cfi_adjust_cfa_offset(4); \
SETUP_PIC_REG (bx); \
addl $_GLOBAL_OFFSET_TABLE_, %ebx; \
xorl %edx, %edx; \
subl %eax, %edx; \
pushl %edx; \
+ cfi_adjust_cfa_offset(4); \
PUSH_ERRNO_LOCATION_RETURN; \
call BP_SYM (__errno_location)@PLT; \
POP_ERRNO_LOCATION_RETURN; \
popl %ecx; \
+ cfi_adjust_cfa_offset(-4); \
popl %ebx; \
+ cfi_adjust_cfa_offset(-4); \
movl %ecx, (%eax); \
orl $-1, %eax; \
jmp L(pseudo_end);
@@ -262,12 +266,12 @@
#define _DOARGS_0(n) /* No arguments to frob. */
#define _POPARGS_0 /* No arguments to pop. */
-#define PUSHARGS_1 movl %ebx, %edx; L(SAVEBX1): PUSHARGS_0
+#define PUSHARGS_1 movl %ebx, %edx; cfi_register (3, 2); L(SAVEBX1): PUSHARGS_0
#define DOARGS_1 _DOARGS_1 (4)
-#define POPARGS_1 POPARGS_0; movl %edx, %ebx; L(RESTBX1):
-#define _PUSHARGS_1 pushl %ebx; L(PUSHBX1): _PUSHARGS_0
+#define POPARGS_1 POPARGS_0; movl %edx, %ebx; cfi_restore (3); L(RESTBX1):
+#define _PUSHARGS_1 pushl %ebx; cfi_adjust_cfa_offset(-4); L(PUSHBX1): _PUSHARGS_0
#define _DOARGS_1(n) movl n(%esp), %ebx; _DOARGS_0(n-4)
-#define _POPARGS_1 _POPARGS_0; popl %ebx; L(POPBX1):
+#define _POPARGS_1 _POPARGS_0; popl %ebx; cfi_adjust_cfa_offset(4); L(POPBX1):
#define PUSHARGS_2 PUSHARGS_1
#define DOARGS_2 _DOARGS_2 (8)
--
http://sources.redhat.com/bugzilla/show_bug.cgi?id=595
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.