Function elf_parser::get_elf_entry

source ·
pub fn get_elf_entry(
    elf: &ElfFile<'_>,
    elf_base_addr: Option<usize>
) -> VirtAddr
Expand description

To parse the elf file and return the segments of the elf file

Arguments

  • elf_data - The elf file data
  • elf_base_addr - The base address of the elf file if the file will be loaded to the memory

Return

Return the entry point

Warning

It can’t be used to parse the elf file which need the dynamic linker, but you can do this by calling this function recursively