diff --git a/Userland/Libraries/LibC/crt0_shared.cpp b/Userland/Libraries/LibC/crt0_shared.cpp index df834b7580..8d18d67412 100644 --- a/Userland/Libraries/LibC/crt0_shared.cpp +++ b/Userland/Libraries/LibC/crt0_shared.cpp @@ -31,36 +31,4 @@ #include #include -extern "C" { - -extern u32 __stack_chk_guard; - -int main(int, char**, char**); - -extern void __libc_init(); -extern void _init(); -extern char** environ; -extern bool __environ_is_malloced; - -int _start(int argc, char** argv, char** env); -int _start(int argc, char** argv, char** env) -{ - u32 original_stack_chk = __stack_chk_guard; - arc4random_buf(&__stack_chk_guard, sizeof(__stack_chk_guard)); - - if (__stack_chk_guard == 0) - __stack_chk_guard = original_stack_chk; - - _init(); - - int status = main(argc, argv, env); - - // Restore the stack guard to the value we entered _start with, - // so we don't trigger the stack canary check on the way out. - __stack_chk_guard = original_stack_chk; - - return status; -} -} - void* __dso_handle __attribute__((__weak__));