This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

ARM: Add .cantunwind to __clone


Backtraces in threads on hardfp EABI systems segfault because they run
off the end of the stack; I've attached a test case.  This happens
because _start is marked with a .cantunwind but __clone is not.

This patch solves the problem on the Fedora 15 hardfp port I'm working
on.  Comments, please.

Andrew.


2011-08-01  Andrew Haley  <aph@redhat.com>

        * sysdeps/unix/sysv/linux/arm/clone.S: Mark as .cantunwind.

--- /home/aph/glibc/glibc-ports/sysdeps/unix/sysv/linux/arm/clone.S	2011-07-29 15:18:34.000000000 +0100
+++ /home/aph/fedora_armv7hl_rootfs/rpmbuild/BUILD/glibc-ports-2.13-26-g9145616/sysdeps/unix/sysv/linux/arm/clone.S	2011-08-01 12:57:14.000000000 +0100
@@ -78,14 +78,17 @@
 	ldr	r4, [sp], #8
 #endif
 	blt	PLTJMP(C_SYMBOL_NAME(__syscall_error))
 	RETINSTR(, lr)

 	cfi_startproc
-	cfi_undefined (lr)
+PSEUDO_END (__clone)
+
 1:
+	.fnstart
+	.cantunwind
 #ifdef RESET_PID
 	tst	ip, #CLONE_THREAD
 	bne	3f
 	mov	r0, #0xffff0fff
 	mov	lr, pc
 	sub	pc, r0, #31
@@ -113,9 +116,9 @@
 	ldr 	pc, [sp], #8
 #endif

 	@ and we are done, passing the return value through r0
 	b	PLTJMP(HIDDEN_JUMPTARGET(_exit))

-PSEUDO_END (__clone)
+	.fnend

 weak_alias (__clone, clone)


Attachment: thread.c
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]