Skip to main content

copy_segment_data

Function copy_segment_data 

Source
unsafe fn copy_segment_data(
    addr_space: &AddressSpace,
    phdr: &ElfPhdr,
    elf: &[u8],
)
Expand description

Copies an ELF segment into the process’s address space

§Safety

The caller must ensure all the following things:

  • p_vaddr to p_vaddr + p_filesz needs to be fully mapped in addr_space
  • No references/pointers to the target frames should exist and no other CPU should be able to concurrently operate on this data