[USER] Init libc with arguments and environment

MESS - execve - Clean up and move earlier
This commit is contained in:
thomas committed 2017-03-27 23:09:09 +02:00
1 parent 8d1e693884
commit 1693baaf6b
9 files changed
+102 -17

No files matched your search

+4 -2
View File
@@ -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
-5
View File
@@ -46,8 +46,3 @@ long __syscall_common(long num, ...)
while(1);
return 0;
}
struct pthread *__pthread_self()
{
return 0;
}
+21
View 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;
}