Implement __stack_chk_fail

This commit is contained in:
flysand7 2023-07-23 18:28:04 +11:00
parent c72164fff0
commit 85e0c445ae
1 changed files with 8 additions and 3 deletions

View File

@ -1,8 +1,13 @@
int __stack_chk_fail() { static char stack_chk_fail_msg[] =
// TODO: implement proper stack protector support "Stack check failed. "
return 0; "You've got a stack corruption somewhere. "
"Sorry these guys didn't tell me where\n";
void __stack_chk_fail(void) {
syscall_write(STDERR_FILENO, stack_chk_fail_msg, sizeof stack_chk_fail_msg);
syscall_exit(1);
} }
void __libc_start_main( void __libc_start_main(