summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/sh/clone.S
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-11-04 20:19:07 +0000
committerEric Andersen <andersen@codepoet.org>2002-11-04 20:19:07 +0000
commit578a13e90fe4ca11ee9bc4e484c20248badb1b32 (patch)
treec1ef0b14a3fa88268d63e48e3f514d843956891c /libc/sysdeps/linux/sh/clone.S
parent72029cf39b801314ff1cf562b9b0521439063bff (diff)
Kill sysdep.h and fixup the SH asm to not use it.
-Erik
Diffstat (limited to 'libc/sysdeps/linux/sh/clone.S')
-rw-r--r--libc/sysdeps/linux/sh/clone.S24
1 files changed, 16 insertions, 8 deletions
diff --git a/libc/sysdeps/linux/sh/clone.S b/libc/sysdeps/linux/sh/clone.S
index ed0357cbc..bc31f48f8 100644
--- a/libc/sysdeps/linux/sh/clone.S
+++ b/libc/sysdeps/linux/sh/clone.S
@@ -19,11 +19,19 @@
/* clone() is even more special than fork() as it mucks with stacks
and invokes a function in the right context after its all over. */
+#include <features.h>
#include <asm/unistd.h>
-#include <sysdep.h>
#define _ERRNO_H 1
#include <bits/errno.h>
+
+#if defined __HAVE_ELF__ && defined __HAVE_SHARED__
+#define PLTJMP(_x) _x##@PLT
+#else
+#define PLTJMP(_x) _x
+#endif
+
+
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
.text
@@ -40,7 +48,7 @@ __clone:
tst r5, r5
bf/s 1f
mov.l .L1, r1
-#ifdef SHARED
+#ifdef __HAVE_SHARED__
mov.l r12, @-r15
sts.l pr, @-r15
mov.l .LG, r12
@@ -59,7 +67,7 @@ __clone:
#endif
.align 2
.L1:
- .long PLTJMP(C_SYMBOL_NAME(__syscall_error))
+ .long PLTJMP(__syscall_error)
1:
/* insert the args onto the new stack */
mov.l r7, @-r5
@@ -77,7 +85,7 @@ __clone:
tst r1, r1 // i.e. error in linux
bf 2f
mov.l .L2, r1
-#ifdef SHARED
+#ifdef __HAVE_SHARED__
mov r0, r4
mov.l r12, @-r15
sts.l pr, @-r15
@@ -97,7 +105,7 @@ __clone:
#endif
.align 2
.L2:
- .long PLTJMP(C_SYMBOL_NAME(__syscall_error))
+ .long PLTJMP(__syscall_error)
2:
tst r0, r0
@@ -112,7 +120,7 @@ __clone:
/* we are done, passing the return value through r0 */
mov.l .L3, r1
-#ifdef SHARED
+#ifdef __HAVE_SHARED__
mov.l r12, @-r15
sts.l pr, @-r15
mov r0, r4
@@ -134,8 +142,8 @@ __clone:
.LG:
.long _GLOBAL_OFFSET_TABLE_
.L3:
- .long PLTJMP(C_SYMBOL_NAME(_exit))
- END(__clone)
+ .long PLTJMP(_exit)
+.size __clone,.-__clone;
.globl clone;
clone = __clone