ELFHeader

Struct ELFHeader 

Source
#[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: u8

Indicates 32-bit or 64-bit format.

§data: u8

Specifies little-endian or big-endian encoding.

§version: u8

ELF version (set to 1 for the original and current version).

§abi: u8

Identifies the target operating system ABI.

§abi_version: u8

Further specifies the ABI version.

§pad: [u8; 7]

Unused padding bytes (must be zero).

§e_type: u16

Object file type (e.g., executable, shared object, relocatable).

§e_machine: u16

Target instruction set architecture.

§e_version: u32

ELF version (should be 1).

§e_entry: u64

Memory address of the entry point where execution starts.

§e_phoff: u64

Offset of the program header table in bytes.

§e_shoff: u64

Offset of the section header table in bytes.

§e_flags: u32

Processor-specific flags.

§e_ehsize: u16

Size of this header in bytes.

§e_phentsize: u16

Size of a program header table entry in bytes.

§e_phnum: u16

Number of entries in the program header table.

§e_shentsize: u16

Size of a section header table entry in bytes.

§e_shnum: u16

Number of entries in the section header table.

§e_shstrndx: u16

Index of the section header table entry that contains section names.

Trait Implementations§

Source§

impl Clone for ELFHeader

Source§

fn clone(&self) -> ELFHeader

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ELFHeader

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 T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.