Skip to content

Commit

Permalink
[ELFLOADER] Call elf init if libc_start_main init is NULL (backported…
Browse files Browse the repository at this point in the history
… from box64) (for #924)
  • Loading branch information
ptitSeb committed Jan 21, 2024
1 parent 99310cc commit d89c104
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/emu/x86run_private.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ int32_t EXPORT my___libc_start_main(x86emu_t* emu, int *(main) (int, char * *, c
if(emu->error) // any error, don't bother with more
return 0;
emu->quit = 0;
} else {
if(my_context->elfs[0]) {
RunElfInit(my_context->elfs[0], emu);
}
}
MarkElfInitDone(my_context->elfs[0]);
printf_log(LOG_DEBUG, "Transfert to main(%d, %p, %p)=>%p from __libc_start_main\n", my_context->argc, my_context->argv, my_context->envv, main);
Expand Down

0 comments on commit d89c104

Please sign in to comment.