[git commit nptl] sh: Align sh clone implementation with glibc

Carmelo Amoroso carmelo.amoroso at st.com
Fri Oct 9 16:10:50 UTC 2009


commit: http://git.uclibc.org/uClibc/commit/?id=defe0a2ced5d3234fb32ceba5fb8bc72f348b859
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/nptl

Align sh clone implementation with glibc one that incorporated
time ago a patch provided by me slightly modified.
The glibc code indeed avoids to load the r3 register if the 2nd
function argument is NULL (r5). No functional change.

Signed-off-by: Carmelo Amoroso <carmelo.amoroso at st.com>
---
 libc/sysdeps/linux/sh/clone.S |   15 +++++++--------
 1 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/libc/sysdeps/linux/sh/clone.S b/libc/sysdeps/linux/sh/clone.S
index 4d933a5..bb56627 100644
--- a/libc/sysdeps/linux/sh/clone.S
+++ b/libc/sysdeps/linux/sh/clone.S
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1999, 2000, 2003, 2004, 2007 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
@@ -34,13 +34,12 @@
 ENTRY(__clone)
 	/* sanity check arguments.  */
 	tst	r4, r4
-	bt	0f
-	tst	r5, r5
-	bf/s	1f
-	mov	#+SYS_ify(clone), r3
-0:	
+	bt/s	0f
+	 tst	r5, r5
+	bf	1f
+0:
 	bra	.Lsyscall_error
-	mov	#-EINVAL,r0
+	 mov	#-EINVAL,r0
 1:
 	/* insert the args onto the new stack */
 	mov.l	r7, @-r5
@@ -52,6 +51,7 @@ ENTRY(__clone)
 	mov.l	@r15, r6
 	mov.l	@(8,r15), r7
 	mov.l	@(4,r15), r0
+	mov	#+SYS_ify(clone), r3
 	trapa	#0x15
 	mov     r0, r1
 	mov	#-12, r2
@@ -129,7 +129,6 @@ ENTRY(__clone)
 .Ltidoff:
 	.word	TID - TLS_PRE_TCB_SIZE
 #endif
-
 PSEUDO_END (__clone)
 
 weak_alias (__clone, clone)
-- 
1.6.3.3



More information about the uClibc-cvs mailing list