rusty_mos::process::elf_loader

Function elf_load_seg

Source
pub fn elf_load_seg(
    ph: *const Elf32Phdr,
    bin: *const u8,
    map_page: ElfMapperFn,
    data: usize,
) -> Result<(), KError>
Expand description

Load an elf-format binary file in memory. This method will map all sections to correct virtual address.

An KError will be transmitted if the map_segment failed.

ยงSafety

The raw ptr SHALL be readable in all loadable sections and the phdr SHALL be valid.