fix debugger tracking of shared libraries on mips with PIE main program
[musl] / src / thread / x86_64 / clone.s
1 .text
2 .global __clone
3 .hidden __clone
4 .type   __clone,@function
5 __clone:
6         xor %eax,%eax
7         mov $56,%al
8         mov %rdi,%r11
9         mov %rdx,%rdi
10         mov %r8,%rdx
11         mov %r9,%r8
12         mov 8(%rsp),%r10
13         mov %r11,%r9
14         and $-16,%rsi
15         sub $8,%rsi
16         mov %rcx,(%rsi)
17         syscall
18         test %eax,%eax
19         jnz 1f
20         xor %ebp,%ebp
21         pop %rdi
22         call *%r9
23         mov %eax,%edi
24         xor %eax,%eax
25         mov $60,%al
26         syscall
27         hlt
28 1:      ret