]> git.corax.cc Git - corax/commitdiff
libc: Call _exit() after returning from main()
authorMatthias Kruk <m@m10k.eu>
Wed, 6 May 2020 03:59:40 +0000 (12:59 +0900)
committerMatthias Kruk <m@m10k.eu>
Wed, 6 May 2020 03:59:40 +0000 (12:59 +0900)
libc/start.S

index 73ccbee0eef159b821a9a318e969e3ca52583311..b874a9c5aa6eed315126c08141efdfcdda824478 100644 (file)
@@ -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