commit 5c6eec82dd4ef1962b92d5d6531f14b6d7a6a30a
Author: Sergei Poselenov <[email protected]>
Date:   Sun Oct 26 14:53:32 2014 +0400

    Fixed clone() for Cortex-M3.
    
    Signed-off-by: Sergei Poselenov <[email protected]>

diff --git a/libc/sysdeps/linux/arm/clone.S b/libc/sysdeps/linux/arm/clone.S
index fdc05b8..6c89a10 100644
--- a/libc/sysdeps/linux/arm/clone.S
+++ b/libc/sysdeps/linux/arm/clone.S
@@ -104,26 +104,24 @@ __clone:
        @ get flags
        mov     r0, r2
        @ new sp is already in r1
-       @ load remaining arguments off the stack
-       stmfd   sp!, {r4}
-       ldr     r2, [sp, #4]
-       ldr     r3, [sp, #8]
-       ldr     r4, [sp, #12]
        DO_CALL (clone)
        movs    a1, a1
        blt     __error
-       ldmnefd sp!, {r4}
        IT(t, ne)
 #if defined(__USE_BX__)
        bxne    lr
 #else
        movne   pc, lr
 #endif
-
        @ pick the function arg and call address off the stack and execute
        ldr     r0, [sp, #4]
-       mov     lr, pc
-       ldr     pc, [sp]
+#if defined(__USE_BX__)
+       ldr     r1, [sp]
+       blx     r1
+#else
+       mov     lr, pc
+       ldr     pc, [sp]
+#endif
 
        @ and we are done, passing the return value through r0
        b       HIDDEN_JUMPTARGET(_exit)


_______________________________________________
uClibc mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to