Kernel - General fixing after ARM7 changes
[tpg/acess2.git] / Usermode / Libraries / crt0.o_src / crt0.x86_64.asm
index 56fa980..fb0115d 100644 (file)
@@ -15,5 +15,17 @@ _start:
 start:
        call main
        push rax
+
+       mov rax, [_crt0_exit_handler]
+       test rax, rax
+       jz .exit
+       call rax
+
+.exit:
        call _exit
        jmp $   ; This should never be reached
+
+[section .bss]
+[global _crt0_exit_handler]
+_crt0_exit_handler:
+       resq    1

UCC git Repository :: git.ucc.asn.au