summary refs log tree commit diff
path: root/sysdeps
diff options
context:
space:
mode:
authorAndreas Jaeger <aj@suse.de>2002-04-22 05:58:12 +0000
committerAndreas Jaeger <aj@suse.de>2002-04-22 05:58:12 +0000
commit04d12383c83e8cba07b96289d313ebad7d0c6ea7 (patch)
tree6631a4dbea12e384ae342cf079233ab76684f6c4 /sysdeps
parent47cbdebd7eb699759a7fc2c13cf226bc82cd23ac (diff)
downloadglibc-04d12383c83e8cba07b96289d313ebad7d0c6ea7.tar.gz
glibc-04d12383c83e8cba07b96289d313ebad7d0c6ea7.tar.xz
glibc-04d12383c83e8cba07b96289d313ebad7d0c6ea7.zip
Use %rdi as temp register instead of destroying %rbx.
Diffstat (limited to 'sysdeps')
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/vfork.S11
1 files changed, 6 insertions, 5 deletions
diff --git a/sysdeps/unix/sysv/linux/x86_64/vfork.S b/sysdeps/unix/sysv/linux/x86_64/vfork.S
index 0b5a90a6c8..79f3260efc 100644
--- a/sysdeps/unix/sysv/linux/x86_64/vfork.S
+++ b/sysdeps/unix/sysv/linux/x86_64/vfork.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2001, 2002 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -27,8 +27,9 @@
 
 ENTRY (__vfork)
 
-	/* Pop the return PC value into RBX.  */
-	popq	%rbx
+	/* Pop the return PC value into RDI.  We need a register that
+	   is preserved by the syscall and that we're allowed to destroy. */
+	popq %rdi
 
 	/* Stuff the syscall number in RAX and enter into the kernel.  */
 	movl	$SYS_ify (vfork), %eax
@@ -37,11 +38,11 @@ ENTRY (__vfork)
 	jae	.Lerror		/* Branch forward if it failed.  */
 
 	/* Jump to the return PC.  */
-	jmp	*%rbx
+	jmp	*%rdi
 
 .Lerror:
 	/* Push back the return PC.  */
-	pushq	%rbx
+	pushq	%rdi
 	jmp	SYSCALL_ERROR_LABEL
 
 .Lpseudo_end: