From d9b7747fc58429cee72dc329725d60ad78a0a1ba Mon Sep 17 00:00:00 2001 From: Bananymous Date: Wed, 19 Apr 2023 00:42:00 +0300 Subject: [PATCH] LibC: exit() calls _fini() --- libc/stdlib.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libc/stdlib.cpp b/libc/stdlib.cpp index b500d27f56..9f30fd09d5 100644 --- a/libc/stdlib.cpp +++ b/libc/stdlib.cpp @@ -4,6 +4,8 @@ #include #include +extern "C" void _fini(); + void abort(void) { ASSERT_NOT_REACHED(); @@ -11,6 +13,7 @@ void abort(void) void exit(int status) { + _fini(); _exit(status); ASSERT_NOT_REACHED(); }