about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2012-07-17 10:06:06 +0200
committerThomas Schwinge <thomas@codesourcery.com>2012-07-17 10:06:06 +0200
commit07cbfc23683827c1b92d0bc62b15a77a48b09a17 (patch)
tree76e56a778029c43bad4f06d3dbd19846ca596739
parentf7db31703ab2e11b162d4e0e3b4af0c1c971b6cd (diff)
downloadglibc-07cbfc23683827c1b92d0bc62b15a77a48b09a17.tar.gz
glibc-07cbfc23683827c1b92d0bc62b15a77a48b09a17.tar.xz
glibc-07cbfc23683827c1b92d0bc62b15a77a48b09a17.zip
SH: makecontext: exit (0) if uc_link is the null pointer.
-rw-r--r--ChangeLog3
-rw-r--r--sysdeps/unix/sysv/linux/sh/makecontext.S3
2 files changed, 5 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9c2930fe4f..751b596361 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2012-07-17  Thomas Schwinge  <thomas@codesourcery.com>
 
+	* sysdeps/unix/sysv/linux/sh/makecontext.S (.Lexitcode): Preserve
+	zero value for regular exit case.
+
 	* sysdeps/unix/sysv/linux/x86_64/__start_context.S
 	(__start_context): Preserve zero value for regular exit case.
 
diff --git a/sysdeps/unix/sysv/linux/sh/makecontext.S b/sysdeps/unix/sysv/linux/sh/makecontext.S
index a04bc9f635..73fca8bf57 100644
--- a/sysdeps/unix/sysv/linux/sh/makecontext.S
+++ b/sysdeps/unix/sysv/linux/sh/makecontext.S
@@ -128,6 +128,7 @@ ENTRY(__makecontext)
 	cfi_restore (pr)
 	/* If this returns (which can happen if the syscall fails) we'll exit
 	   the program with the return error value (-1).  */
+	mov	r0, r4
 
 2:
 	mov.l	.Lexit, r1
@@ -135,7 +136,7 @@ ENTRY(__makecontext)
 	add	r12, r1
 #endif
 	jsr	@r1
-	 mov	r0, r4
+	 nop
 	/* The 'exit' call should never return.  In case it does cause the
 	   process to terminate.  */
 	ABORT_INSTRUCTION_ASM