Skip to main content

load_segment

Function load_segment 

Source
fn load_segment(
    user_as: &AddressSpace,
    elf_data: &[u8],
    phdr: &Elf64Phdr,
    load_bias: u64,
) -> Result<(), &'static str>
Expand description

Load a single PT_LOAD segment into the given address space.

Allocates physical frames, maps them with appropriate permissions, and copies file data into the mapping. BSS (memsz > filesz) is already zero-filled because map_region zeroes newly allocated frames.