123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- #include <bits/errno.h>
- #include <sys/syscall.h>
- .text
- .align 4
- .type __clone,@function
- .globl __clone;
- __clone:
-
- movl 4(%esp),%ecx
- jecxz CLONE_ERROR_LABEL
- movl 8(%esp),%ecx
- jecxz CLONE_ERROR_LABEL
-
- subl $8,%ecx
- movl 16(%esp),%eax
- movl %eax,4(%ecx)
-
- movl 4(%esp),%eax
- movl %eax,0(%ecx)
-
- pushl %ebx
- movl 16(%esp),%ebx
- movl $__NR_clone,%eax
- int $0x80
- popl %ebx
- test %eax,%eax
- jl CLONE_ERROR_LABEL
- jne CLONE_RETURN_LABEL
-
- subl %ebp,%ebp
- call *%ebx
- pushl %eax
- call _exit
- CLONE_ERROR_LABEL:
- negl %eax
- pushl %eax
- #ifdef __PIC__
- call .Lhere
- .Lhere:
- popl %ebx
- addl $_GLOBAL_OFFSET_TABLE_+[.- .Lhere ], %ebx
- call __errno_location@PLT
- #else
- call __errno_location
- #endif
- popl %ecx
- movl %ecx, (%eax)
- xorl %eax, %eax
- decl %eax
- CLONE_RETURN_LABEL:
- ret
- .globl clone;
- clone = __clone
|