2023-07-22 14:30:04 +00:00
|
|
|
|
2023-07-22 15:23:39 +00:00
|
|
|
|
2023-07-22 16:28:16 +00:00
|
|
|
int __stack_chk_fail() {
|
2023-07-22 15:23:39 +00:00
|
|
|
// TODO: implement proper stack protector support
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2023-07-22 14:30:04 +00:00
|
|
|
void __libc_start_main(
|
|
|
|
int (*main)(int, char**, char**),
|
|
|
|
int argc, char **argv,
|
|
|
|
int (*init)(int, char**, char**),
|
|
|
|
void (*fini)(void),
|
2023-07-22 16:28:16 +00:00
|
|
|
void (*runtime_ld_fini)(void),
|
2023-07-22 14:30:04 +00:00
|
|
|
void *stack_end
|
|
|
|
) {
|
2023-07-22 16:28:16 +00:00
|
|
|
char **envp = argv + (argc + 1);
|
|
|
|
init(argc, argv, envp);
|
|
|
|
main(argc, argv, envp);
|
|
|
|
fini();
|
|
|
|
if(runtime_ld_fini != NULL) {
|
|
|
|
runtime_ld_fini();
|
|
|
|
}
|
2023-07-22 14:30:04 +00:00
|
|
|
syscall_exit(0);
|
|
|
|
}
|