1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

Kernel+LibELF: Abort ELF executable load sooner when something fails

Make it possible to bail out of ELF::Image::for_each_program_header()
and then do exactly that if something goes wrong during executable
loading in the kernel.

Also make the errors we return slightly more nuanced than just ENOEXEC.
This commit is contained in:
Andreas Kling 2020-12-25 14:42:42 +01:00
parent 791b32e3c6
commit 6c9a6bea1e
5 changed files with 52 additions and 39 deletions

View file

@ -208,8 +208,10 @@ bool Emulator::load_elf()
m_loader_text_size = region->size();
}
mmu().add_region(move(region));
return;
return IterationDecision::Continue;
}
return IterationDecision::Continue;
});
auto entry_point = interpreter_image.entry().offset(interpreter_load_offset).get();