Struct object::elf::FileHeader64

source ·
#[repr(C)]
pub struct FileHeader64<E: Endian> {
Show 14 fields pub e_ident: Ident, pub e_type: U16<E>, pub e_machine: U16<E>, pub e_version: U32<E>, pub e_entry: U64<E>, pub e_phoff: U64<E>, pub e_shoff: U64<E>, pub e_flags: U32<E>, pub e_ehsize: U16<E>, pub e_phentsize: U16<E>, pub e_phnum: U16<E>, pub e_shentsize: U16<E>, pub e_shnum: U16<E>, pub e_shstrndx: U16<E>,
}
Expand description

The header at the start of every 64-bit ELF file.

Fields§

§e_ident: Ident

Magic number and other information.

§e_type: U16<E>

Object file type. One of the ET_* constants.

§e_machine: U16<E>

Architecture. One of the EM_* constants.

§e_version: U32<E>

Object file version. Must be EV_CURRENT.

§e_entry: U64<E>

Entry point virtual address.

§e_phoff: U64<E>

Program header table file offset.

§e_shoff: U64<E>

Section header table file offset.

§e_flags: U32<E>

Processor-specific flags.

A combination of the EF_* constants.

§e_ehsize: U16<E>

Size in bytes of this header.

§e_phentsize: U16<E>

Program header table entry size.

§e_phnum: U16<E>

Program header table entry count.

If the count is greater than or equal to PN_XNUM then this field is set to PN_XNUM and the count is stored in the sh_info field of section 0.

§e_shentsize: U16<E>

Section header table entry size.

§e_shnum: U16<E>

Section header table entry count.

If the count is greater than or equal to SHN_LORESERVE then this field is set to 0 and the count is stored in the sh_size field of section 0. first section header.

§e_shstrndx: U16<E>

Section header string table index.

If the index is greater than or equal to SHN_LORESERVE then this field is set to SHN_XINDEX and the index is stored in the sh_link field of section 0.

Trait Implementations§

source§

impl<E: Clone + Endian> Clone for FileHeader64<E>

source§

fn clone(&self) -> FileHeader64<E>

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl<E: Debug + Endian> Debug for FileHeader64<E>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Endian: Endian> FileHeader for FileHeader64<Endian>

§

type Word = u64

§

type Sword = i64

§

type Endian = Endian

§

type ProgramHeader = ProgramHeader64<Endian>

§

type SectionHeader = SectionHeader64<Endian>

§

type CompressionHeader = CompressionHeader64<Endian>

§

type NoteHeader = NoteHeader32<Endian>

§

type Dyn = Dyn64<Endian>

§

type Sym = Sym64<Endian>

§

type Rel = Rel64<Endian>

§

type Rela = Rela64<Endian>

source§

fn is_type_64(&self) -> bool

Return true if this type is a 64-bit header. Read more
source§

fn is_type_64_sized() -> bool
where Self: Sized,

Return true if this type is a 64-bit header. Read more
source§

fn e_ident(&self) -> &Ident

source§

fn e_type(&self, endian: Self::Endian) -> u16

source§

fn e_machine(&self, endian: Self::Endian) -> u16

source§

fn e_version(&self, endian: Self::Endian) -> u32

source§

fn e_entry(&self, endian: Self::Endian) -> Self::Word

source§

fn e_phoff(&self, endian: Self::Endian) -> Self::Word

source§

fn e_shoff(&self, endian: Self::Endian) -> Self::Word

source§

fn e_flags(&self, endian: Self::Endian) -> u32

source§

fn e_ehsize(&self, endian: Self::Endian) -> u16

source§

fn e_phentsize(&self, endian: Self::Endian) -> u16

source§

fn e_phnum(&self, endian: Self::Endian) -> u16

source§

fn e_shentsize(&self, endian: Self::Endian) -> u16

source§

fn e_shnum(&self, endian: Self::Endian) -> u16

source§

fn e_shstrndx(&self, endian: Self::Endian) -> u16

source§

fn parse<'data, R: ReadRef<'data>>(data: R) -> Result<&'data Self>

Read the file header. Read more
source§

fn is_supported(&self) -> bool

Check that the ident field in the file header is a supported format. Read more
source§

fn is_class_32(&self) -> bool

source§

fn is_class_64(&self) -> bool

source§

fn is_little_endian(&self) -> bool

source§

fn is_big_endian(&self) -> bool

source§

fn endian(&self) -> Result<Self::Endian>

source§

fn section_0<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<Option<&'data Self::SectionHeader>>

Return the first section header, if present. Read more
source§

fn phnum<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<usize>

Return the e_phnum field of the header. Handles extended values. Read more
source§

fn shnum<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<usize>

Return the e_shnum field of the header. Handles extended values. Read more
source§

fn shstrndx<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<u32>

Return the e_shstrndx field of the header. Handles extended values. Read more
source§

fn program_headers<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<&'data [Self::ProgramHeader]>

Return the slice of program headers. Read more
source§

fn section_headers<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<&'data [Self::SectionHeader]>

Return the slice of section headers. Read more
source§

fn section_strings<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, sections: &[Self::SectionHeader], ) -> Result<StringTable<'data, R>>

Return the string table for the section headers.
source§

fn sections<'data, R: ReadRef<'data>>( &self, endian: Self::Endian, data: R, ) -> Result<SectionTable<'data, Self, R>>

Return the section table.
source§

fn is_mips64el(&self, endian: Self::Endian) -> bool

Returns whether this is a mips64el elf file.
source§

impl<E: Copy + Endian> Copy for FileHeader64<E>

source§

impl<E: Endian> Pod for FileHeader64<E>

Auto Trait Implementations§

§

impl<E> Freeze for FileHeader64<E>

§

impl<E> RefUnwindSafe for FileHeader64<E>
where E: RefUnwindSafe,

§

impl<E> Send for FileHeader64<E>
where E: Send,

§

impl<E> Sync for FileHeader64<E>
where E: Sync,

§

impl<E> Unpin for FileHeader64<E>
where E: Unpin,

§

impl<E> UnwindSafe for FileHeader64<E>
where E: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

source§

fn into(self) -> U

Calls U::from(self).

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

source§

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

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

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

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

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

§

type Error = Infallible

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

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

Performs the conversion.
source§

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.
source§

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

Performs the conversion.