LibC: Rework constructor/destructor calling

constructors are now called in _init_libc instead of crt0

destructors are now registered with atexit() instead of called manually
This commit is contained in:
2025-04-15 22:29:26 +03:00
parent 066ed7e4a1
commit cf59f89bfb
4 changed files with 46 additions and 37 deletions

View File

@@ -23,8 +23,6 @@ char** __environ;
weak_alias(__environ, environ);
static bool s_environ_malloced = false;
extern "C" __attribute__((weak)) void _fini();
void abort(void)
{
sigset_t set;
@@ -43,7 +41,6 @@ void exit(int status)
{
fflush(nullptr);
__cxa_finalize(nullptr);
if (_fini) _fini();
_exit(status);
ASSERT_NOT_REACHED();
}