about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2012-07-17 10:06:02 +0200
committerThomas Schwinge <thomas@codesourcery.com>2012-07-17 10:06:02 +0200
commitf7db31703ab2e11b162d4e0e3b4af0c1c971b6cd (patch)
tree3c1f2de92251e71867338b86b94fcbfff9a0a7fb
parentdc97c227c95dd521594f1eaa472399b9fba03b2a (diff)
downloadglibc-f7db31703ab2e11b162d4e0e3b4af0c1c971b6cd.tar.gz
glibc-f7db31703ab2e11b162d4e0e3b4af0c1c971b6cd.tar.xz
glibc-f7db31703ab2e11b162d4e0e3b4af0c1c971b6cd.zip
x86_64: makecontext: exit (0) if uc_link is the null pointer.
-rw-r--r--ChangeLog5
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/__start_context.S5
2 files changed, 8 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index fce46177e4..9c2930fe4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,9 @@
 2012-07-17  Thomas Schwinge  <thomas@codesourcery.com>
+
+	* sysdeps/unix/sysv/linux/x86_64/__start_context.S
+	(__start_context): Preserve zero value for regular exit case.
+
+2012-07-17  Thomas Schwinge  <thomas@codesourcery.com>
 	    Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>
 
 	* manual/setjmp.texi (setcontext): Clarify normal process
diff --git a/sysdeps/unix/sysv/linux/x86_64/__start_context.S b/sysdeps/unix/sysv/linux/x86_64/__start_context.S
index 77d322e046..9f2ee23736 100644
--- a/sysdeps/unix/sysv/linux/x86_64/__start_context.S
+++ b/sysdeps/unix/sysv/linux/x86_64/__start_context.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 2002-2012 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Andreas Jaeger <aj@suse.de>, 2002.
 
@@ -39,8 +39,9 @@ ENTRY(__start_context)
 	call	JUMPTARGET(__setcontext)
 	/* If this returns (which can happen if the syscall fails) we'll
 	   exit the program with the return error value (-1).  */
+	movq	%rax,%rdi
 
-2:	movq	%rax,%rdi
+2:
 	call	HIDDEN_JUMPTARGET(exit)
 	/* The 'exit' call should never return.  In case it does cause
 	   the process to terminate.  */