From 40b3565d79c0fd55f83e6470a458945efa21f6da Mon Sep 17 00:00:00 2001 From: John Hodge Date: Tue, 11 Oct 2011 17:01:22 +0800 Subject: [PATCH] Libraries/ld-acess - Cleaning up --- Usermode/Libraries/ld-acess.so_src/arch/x86_64.asm.h | 11 +++++++++-- Usermode/Libraries/ld-acess.so_src/loadlib.c | 2 +- Usermode/Libraries/libc.so_src/stub.c | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Usermode/Libraries/ld-acess.so_src/arch/x86_64.asm.h b/Usermode/Libraries/ld-acess.so_src/arch/x86_64.asm.h index 2c9d87fc..ea605ef6 100644 --- a/Usermode/Libraries/ld-acess.so_src/arch/x86_64.asm.h +++ b/Usermode/Libraries/ld-acess.so_src/arch/x86_64.asm.h @@ -142,8 +142,10 @@ _SYSCALL_TAIL ; // Override the clone syscall #define clone _clone_raw +#define _exit _exit_raw #include "syscalls.s.h" #undef clone +#undef _exit [global clone:func] clone: @@ -162,11 +164,16 @@ clone: sub rsi, 3*8 .doCall: mov eax, SYS_CLONE - mov rdi, rsi ; Stack - mov rsi, [rbp+2*8] ; Flags SYSCALL_OP mov [rel _errno], ebx pop rbx pop rbp ret +[global _exit:func] +_exit: + xor eax, eax + SYSCALL_OP + jmp $ + +; vim: ft=nasm diff --git a/Usermode/Libraries/ld-acess.so_src/loadlib.c b/Usermode/Libraries/ld-acess.so_src/loadlib.c index 182109bf..b6637c22 100644 --- a/Usermode/Libraries/ld-acess.so_src/loadlib.c +++ b/Usermode/Libraries/ld-acess.so_src/loadlib.c @@ -5,7 +5,7 @@ #include "common.h" #include -#define DEBUG 1 +#define DEBUG 0 #if DEBUG # define DEBUGS(v...) SysDebug(v) diff --git a/Usermode/Libraries/libc.so_src/stub.c b/Usermode/Libraries/libc.so_src/stub.c index fbdf30d0..3cab984d 100644 --- a/Usermode/Libraries/libc.so_src/stub.c +++ b/Usermode/Libraries/libc.so_src/stub.c @@ -83,6 +83,7 @@ int ErrorHandler(int Fault) // fprintf(stderr, "%02i: %p %s\n", i, gLoadedLibraries[i].Base, gLoadedLibraries[i].Name); } fprintf(stderr, "\n"); + exit(-1); return -1; } -- 2.20.1