From c21b7e64b85e18113f7bf01b72bbc7904b55e2c6 Mon Sep 17 00:00:00 2001 From: David McCullough Date: Tue, 17 Sep 2002 01:43:35 +0000 Subject: Add in clone and make the assembler PIC/msep-data friendly. --- libc/sysdeps/linux/m68k/clone.S | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'libc') diff --git a/libc/sysdeps/linux/m68k/clone.S b/libc/sysdeps/linux/m68k/clone.S index 1f900685e..d1e4fd850 100644 --- a/libc/sysdeps/linux/m68k/clone.S +++ b/libc/sysdeps/linux/m68k/clone.S @@ -9,9 +9,12 @@ #include /* int _clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */ - + .text .align 4 +.type clone,@function +.globl clone; +clone: .type __clone,@function .globl __clone; __clone: @@ -20,11 +23,11 @@ __clone: movel 4(%sp), %d1 /* no NULL function pointers */ movel %d1, %a0 tstl %d1 - jeq syscall_error + beq.w syscall_error movel 8(%sp), %d1 /* no NULL stack pointers */ movel %d1, %a1 tstl %d1 - jeq syscall_error + beq.w syscall_error /* Allocate space and copy the argument onto the new stack. */ movel 16(%sp), -(%a1) @@ -49,8 +52,8 @@ __clone: #endif tstl %d0 - jmi syscall_error - jeq thread_start + bmi.w syscall_error + beq.w thread_start rts @@ -58,7 +61,7 @@ syscall_error: negl %d0 movel %d0, %sp@- lea __errno_location-.-8, %a0 - jsr 0(%pc, %a0) + jsr %pc@(%a0) movel %d0, %a0 movel %sp@+, %a0@ moveq #-1, %d0 @@ -73,3 +76,10 @@ thread_start: trap #0 /*jsr exit*/ +#if defined(HAVE_ELF) + .weak clone + clone = __clone +#else + .set clone,__clone +#endif + -- cgit v1.2.3