svn commit: branches/uClibc-nptl/libc/sysdeps/linux/arm

sjhill at uclibc.org sjhill at uclibc.org
Thu Jul 6 01:41:11 UTC 2006


Author: sjhill
Date: 2006-07-05 18:41:10 -0700 (Wed, 05 Jul 2006)
New Revision: 15655

Log:
Merge from trunk.


Modified:
   branches/uClibc-nptl/libc/sysdeps/linux/arm/sigaction.c
   branches/uClibc-nptl/libc/sysdeps/linux/arm/sigrestorer.S


Changeset:
Modified: branches/uClibc-nptl/libc/sysdeps/linux/arm/sigaction.c
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/arm/sigaction.c	2006-07-06 01:40:24 UTC (rev 15654)
+++ branches/uClibc-nptl/libc/sysdeps/linux/arm/sigaction.c	2006-07-06 01:41:10 UTC (rev 15655)
@@ -57,14 +57,7 @@
 	memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t));
 	kact.sa_flags = act->sa_flags;
 # ifdef HAVE_SA_RESTORER
-	/* If the user specified SA_ONSTACK this means she is trying to
-	   use the old-style stack switching.  Unfortunately this
-	   requires the sa_restorer field so we cannot install our own
-	   handler.  (In fact the user is likely to be out of luck anyway
-	   since the kernel currently only supports stack switching via
-	   the X/Open sigaltstack interface, but we allow for the
-	   possibility that this might change in the future.)  */
-	if (kact.sa_flags & (SA_RESTORER | SA_ONSTACK)) {
+	if (kact.sa_flags & SA_RESTORER) {
 	    kact.sa_restorer = act->sa_restorer;
 	} else {
 	    kact.sa_restorer = choose_restorer (kact.sa_flags);
@@ -103,8 +96,7 @@
 	kact.sa_mask = act->sa_mask.__val[0];
 	kact.sa_flags = act->sa_flags;
 # ifdef HAVE_SA_RESTORER
-	/* See the comments above for why we test SA_ONSTACK.  */
-	if (kact.sa_flags & (SA_RESTORER | SA_ONSTACK)) {
+	if (kact.sa_flags & SA_RESTORER) {
 	    kact.sa_restorer = act->sa_restorer;
 	} else {
 	    kact.sa_restorer = choose_restorer (kact.sa_flags);

Modified: branches/uClibc-nptl/libc/sysdeps/linux/arm/sigrestorer.S
===================================================================
--- branches/uClibc-nptl/libc/sysdeps/linux/arm/sigrestorer.S	2006-07-06 01:40:24 UTC (rev 15654)
+++ branches/uClibc-nptl/libc/sysdeps/linux/arm/sigrestorer.S	2006-07-06 01:41:10 UTC (rev 15655)
@@ -20,13 +20,33 @@
 
 /* If no SA_RESTORER function was specified by the application we use
    one of these.  This avoids the need for the kernel to synthesise a return
-   instruction on the stack, which would involve expensive cache flushes. */
+   instruction on the stack, which would involve expensive cache flushes.
 
+   Nowadays (2.6 series, and somewhat earlier) the kernel uses a high page
+   for signal trampolines, so the cache flushes are not an issue.  But since
+   we do not have a vDSO, continue to use these so that we can provide
+   unwind information.
+
+   Start the unwind tables at least one instruction before the signal
+   trampoline, because the unwinder will assume we are returning after
+   a call site.  */
+
 .global __default_sa_restorer
 .type __default_sa_restorer,%function
 .align 2
+#ifdef __ARM_EABI__
+	.fnstart
+	.save {r0-r15}
+	.pad #12
+	nop
 __default_sa_restorer:
+	mov	r7, $SYS_ify(sigreturn)
+	swi	0x0
+	.fnend
+#else
+__default_sa_restorer:
 	DO_CALL (sigreturn)
+#endif
 
 
 #ifdef __NR_rt_sigreturn
@@ -34,7 +54,18 @@
 .global __default_rt_sa_restorer
 .type __default_rt_sa_restorer,%function
 .align 2
+#ifdef __ARM_EABI__
+	.fnstart
+	.save {r0-r15}
+	.pad #168
+	nop
 __default_rt_sa_restorer:
+	mov	r7, $SYS_ify(rt_sigreturn)
+	swi	0x0
+	.fnend
+#else
+__default_rt_sa_restorer:
 	DO_CALL (rt_sigreturn)
+#endif
 
 #endif




More information about the uClibc-cvs mailing list