glibc/glibc-2.7-provide_CFI_for_the_outermost_function.patch
2012-02-01 14:42:15 +04:00

58 lines
1.9 KiB
Diff

2006-11-30 Jan Kratochvil <jan.kratochvil@redhat.com>
* sysdeps/unix/sysv/linux/i386/clone.S: Provide CFI for the outermost
`clone' function to ensure proper unwinding stop of gdb.
* sysdeps/unix/sysv/linux/x86_64/clone.S: Likewise.
Index: sysdeps/unix/sysv/linux/i386/clone.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/i386/clone.S,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -p -r1.26 -r1.27
--- sysdeps/unix/sysv/linux/i386/clone.S 4 May 2005 17:52:08 -0000 1.26
+++ sysdeps/unix/sysv/linux/i386/clone.S 3 Dec 2006 23:12:36 -0000 1.27
@@ -120,6 +120,9 @@ L(pseudo_end):
ret
L(thread_start):
+ cfi_startproc;
+ /* Clearing frame pointer is insufficient, use CFI. */
+ cfi_undefined (eip);
/* Note: %esi is zero. */
movl %esi,%ebp /* terminate the stack frame */
#ifdef RESET_PID
@@ -152,6 +155,7 @@ L(nomoregetpid):
jmp L(haspid)
.previous
#endif
+ cfi_endproc;
cfi_startproc
PSEUDO_END (BP_SYM (__clone))
Index: sysdeps/unix/sysv/linux/x86_64/clone.S
===================================================================
RCS file: /cvs/glibc/libc/sysdeps/unix/sysv/linux/x86_64/clone.S,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- sysdeps/unix/sysv/linux/x86_64/clone.S 31 Mar 2005 10:00:12 -0000 1.6
+++ sysdeps/unix/sysv/linux/x86_64/clone.S 3 Dec 2006 23:12:36 -0000 1.7
@@ -89,6 +89,9 @@ L(pseudo_end):
ret
L(thread_start):
+ cfi_startproc;
+ /* Clearing frame pointer is insufficient, use CFI. */
+ cfi_undefined (rip);
/* Clear the frame pointer. The ABI suggests this be done, to mark
the outermost frame obviously. */
xorl %ebp, %ebp
@@ -113,6 +116,7 @@ L(thread_start):
/* Call exit with return value from function call. */
movq %rax, %rdi
call HIDDEN_JUMPTARGET (_exit)
+ cfi_endproc;
cfi_startproc;
PSEUDO_END (BP_SYM (__clone))