/* --- !!! --- EXTERNAL HEADERS end --- !!! --- */
/* Avoid compiler warnings: this fn _is_ used, but labelling it
- 'static' causes gcc to complain it isn't. */
+ 'static' causes gcc to complain it isn't.
+ attribute 'used' also ensures the code is not eliminated at link
+ time */
+__attribute__ ((used))
void _start_in_C_linux ( UWord* pArgc );
+__attribute__ ((used))
void _start_in_C_linux ( UWord* pArgc )
{
Int r;
#if defined(VGP_x86_linux)
# define _MY_SIGRETURN(name) \
".text\n" \
+ ".globl my_sigreturn\n" \
"my_sigreturn:\n" \
" movl $" #name ", %eax\n" \
" int $0x80\n" \
#elif defined(VGP_amd64_linux)
# define _MY_SIGRETURN(name) \
".text\n" \
+ ".globl my_sigreturn\n" \
"my_sigreturn:\n" \
" movq $" #name ", %rax\n" \
" syscall\n" \
#elif defined(VGP_ppc32_linux)
# define _MY_SIGRETURN(name) \
".text\n" \
+ ".globl my_sigreturn\n" \
"my_sigreturn:\n" \
" li 0, " #name "\n" \
" sc\n" \
#elif defined(VGP_arm_linux)
# define _MY_SIGRETURN(name) \
".text\n" \
+ ".globl my_sigreturn\n" \
"my_sigreturn:\n\t" \
" mov r7, #" #name "\n\t" \
" svc 0x00000000\n" \
#elif defined(VGP_x86_darwin)
# define _MY_SIGRETURN(name) \
".text\n" \
+ ".globl my_sigreturn\n" \
"my_sigreturn:\n" \
"movl $" VG_STRINGIFY(__NR_DARWIN_FAKE_SIGRETURN) ",%eax\n" \
"int $0x80"
// DDD: todo
# define _MY_SIGRETURN(name) \
".text\n" \
+ ".globl my_sigreturn\n" \
"my_sigreturn:\n" \
"ud2\n"
#elif defined(VGP_s390x_linux)
# define _MY_SIGRETURN(name) \
".text\n" \
+ ".globl my_sigreturn\n" \
"my_sigreturn:\n" \
" svc " #name "\n" \
".previous\n"
);
asm(
".text\n"
+".globl do_syscall_WRK\n"
"do_syscall_WRK:\n"
" push %esi\n"
" push %edi\n"
);
asm(
".text\n"
+".globl do_syscall_WRK\n"
"do_syscall_WRK:\n"
/* Convert function calling convention --> syscall calling
convention */
);
asm(
".text\n"
+".globl do_syscall_WRK\n"
"do_syscall_WRK:\n"
" mr 0,3\n"
" mr 3,4\n"
);
asm(
".text\n"
+".globl do_syscall_WRK\n"
"do_syscall_WRK:\n"
" push {r4, r5, r7}\n"
" ldr r4, [sp, #12]\n"
asm(
" .text\n"
" .align 4\n"
+ ".globl do_syscall_clone_s390x_linux\n"
"do_syscall_clone_s390x_linux:\n"
" lg %r1, 160(%r15)\n" // save fn from parent stack into r1
" lg %r0, 168(%r15)\n" // save arg from parent stack into r0