1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:47:34 +00:00

LibC: Tidy up _start a bit and rename compilation unit to "crt0"

This commit is contained in:
Andreas Kling 2019-02-22 09:21:54 +01:00
parent 1da261eeb6
commit 42342d2337
2 changed files with 5 additions and 7 deletions

38
LibC/crt0.cpp Normal file
View file

@ -0,0 +1,38 @@
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
extern "C" {
int main(int, char**);
int errno;
char** environ;
void __malloc_init();
void __stdio_init();
int _start(int argc, char** argv, char** env)
{
errno = 0;
environ = env;
__stdio_init();
__malloc_init();
int status = main(argc, argv);
fflush(stdout);
fflush(stderr);
exit(status);
return 20150614;
}
[[noreturn]] void __cxa_pure_virtual()
{
assert(false);
}
}