#[repr(C)]pub struct ELFHeader {Show 20 fields
pub magic: [u8; 4],
pub class: u8,
pub data: u8,
pub version: u8,
pub abi: u8,
pub abi_version: u8,
pub pad: [u8; 7],
pub e_type: u16,
pub e_machine: u16,
pub e_version: u32,
pub e_entry: u64,
pub e_phoff: u64,
pub e_shoff: u64,
pub e_flags: u32,
pub e_ehsize: u16,
pub e_phentsize: u16,
pub e_phnum: u16,
pub e_shentsize: u16,
pub e_shnum: u16,
pub e_shstrndx: u16,
}Expand description
Represents the ELF file header.
This structure contains metadata about the ELF file, such as its type, architecture, entry point, and various offsets for program and section headers.
Fields§
§magic: [u8; 4]The ELF magic number (0x7F followed by ELF in ASCII).
class: u8Indicates 32-bit or 64-bit format.
data: u8Specifies little-endian or big-endian encoding.
version: u8ELF version (set to 1 for the original and current version).
abi: u8Identifies the target operating system ABI.
abi_version: u8Further specifies the ABI version.
pad: [u8; 7]Unused padding bytes (must be zero).
e_type: u16Object file type (e.g., executable, shared object, relocatable).
e_machine: u16Target instruction set architecture.
e_version: u32ELF version (should be 1).
e_entry: u64Memory address of the entry point where execution starts.
e_phoff: u64Offset of the program header table in bytes.
e_shoff: u64Offset of the section header table in bytes.
e_flags: u32Processor-specific flags.
e_ehsize: u16Size of this header in bytes.
e_phentsize: u16Size of a program header table entry in bytes.
e_phnum: u16Number of entries in the program header table.
e_shentsize: u16Size of a section header table entry in bytes.
e_shnum: u16Number of entries in the section header table.
e_shstrndx: u16Index of the section header table entry that contains section names.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ELFHeader
impl RefUnwindSafe for ELFHeader
impl Send for ELFHeader
impl Sync for ELFHeader
impl Unpin for ELFHeader
impl UnwindSafe for ELFHeader
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)