From: Matthias Kruk Date: Wed, 6 May 2020 03:59:40 +0000 (+0900) Subject: libc: Call _exit() after returning from main() X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=daa226c3f23fe7b909f236026f79e5c7d9399e94;p=corax libc: Call _exit() after returning from main() --- diff --git a/libc/start.S b/libc/start.S index 73ccbee..b874a9c 100644 --- a/libc/start.S +++ b/libc/start.S @@ -3,8 +3,15 @@ .global _start .extern main - .extern exit + .extern _exit _start: call main - jmp _start + + pushl %eax +0: call _exit + + /* we *should* never reach this */ + + movl %eax, (%esp) + jmp 0b