Add C-style definitions for Elf[32|64]_Phdr
This commit is contained in:
parent
840dd99239
commit
04242deb6f
@ -5,6 +5,36 @@ use crate::parse::{ParseAt, ParseError, ParsingTable};
|
||||
|
||||
pub type SegmentTable<'data, E> = ParsingTable<'data, E, ProgramHeader>;
|
||||
|
||||
/// C-style 32-bit ELF Program Segment Header definition
|
||||
///
|
||||
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
|
||||
#[repr(C)]
|
||||
pub struct Elf32_Phdr {
|
||||
pub p_type: u32,
|
||||
pub p_offset: u32,
|
||||
pub p_vaddr: u32,
|
||||
pub p_paddr: u32,
|
||||
pub p_filesz: u32,
|
||||
pub p_memsz: u32,
|
||||
pub p_flags: u32,
|
||||
pub p_align: u32,
|
||||
}
|
||||
|
||||
/// C-style 64-bit ELF Program Segment Header definition
|
||||
///
|
||||
/// These C-style definitions are for users who want to implement their own ELF manipulation logic.
|
||||
#[repr(C)]
|
||||
pub struct Elf64_Phdr {
|
||||
pub p_type: u32,
|
||||
pub p_flags: u32,
|
||||
pub p_offset: u64,
|
||||
pub p_vaddr: u64,
|
||||
pub p_paddr: u64,
|
||||
pub p_filesz: u64,
|
||||
pub p_memsz: u64,
|
||||
pub p_align: u64,
|
||||
}
|
||||
|
||||
/// Encapsulates the contents of an ELF Program Header
|
||||
///
|
||||
/// The program header table is an array of program header structures describing
|
||||
|
Loading…
x
Reference in New Issue
Block a user