[USER] Init libc with arguments and environment
MESS - execve - Clean up and move earlier
This commit is contained in:
@@ -13,10 +13,12 @@
|
||||
|
||||
call _init
|
||||
|
||||
pop rdi
|
||||
pop rsi
|
||||
pop rdx
|
||||
movabs rax, offset main
|
||||
mov rdi, rax
|
||||
|
||||
call main
|
||||
call __libc_start_main
|
||||
|
||||
call _fini
|
||||
|
||||
|
||||
@@ -46,8 +46,3 @@ long __syscall_common(long num, ...)
|
||||
while(1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct pthread *__pthread_self()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
21
libc/thread.c
Normal file
21
libc/thread.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "syscalls.h"
|
||||
|
||||
struct pthread *__pt;
|
||||
|
||||
struct pthread *__pthread_self()
|
||||
{
|
||||
return __pt;
|
||||
}
|
||||
|
||||
SYSCALL_DEF(set_thread_area)
|
||||
{
|
||||
SYSCALL_INIT(void *, ptr);
|
||||
__pt = ptr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
SYSCALL_DEF(set_tid_address)
|
||||
{
|
||||
SYSCALL_INIT();
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user