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
commit 6c9a6bea1e
Notes: sideshowbarker 2024-07-19 00:36:51 +09:00
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();