Struct object::elf::FileHeader32  
source · [−]#[repr(C)]pub struct FileHeader32<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: U32<E>,
    pub e_phoff: U32<E>,
    pub e_shoff: U32<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 32-bit ELF file.
Fields
e_ident: IdentMagic 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: U32<E>Entry point virtual address.
e_phoff: U32<E>Program header table file offset.
e_shoff: U32<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
sourceimpl<E: Clone + Endian> Clone for FileHeader32<E>
 
impl<E: Clone + Endian> Clone for FileHeader32<E>
sourcefn clone(&self) -> FileHeader32<E>
 
fn clone(&self) -> FileHeader32<E>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
 
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl<E: Debug + Endian> Debug for FileHeader32<E>
 
impl<E: Debug + Endian> Debug for FileHeader32<E>
sourceimpl<Endian: Endian> FileHeader for FileHeader32<Endian>
 
impl<Endian: Endian> FileHeader for FileHeader32<Endian>
type Word = u32
type Sword = i32
type Endian = Endian
type ProgramHeader = ProgramHeader32<Endian>
type SectionHeader = SectionHeader32<Endian>
type CompressionHeader = CompressionHeader32<Endian>
type NoteHeader = NoteHeader32<Endian>
type Dyn = Dyn32<Endian>
type Sym = Sym32<Endian>
type Rel = Rel32<Endian>
type Rela = Rela32<Endian>
sourcefn is_type_64(&self) -> bool
 
fn is_type_64(&self) -> bool
Return true if this type is a 64-bit header. Read more
fn e_ident(&self) -> &Ident
fn e_type(&self, endian: Self::Endian) -> u16
fn e_machine(&self, endian: Self::Endian) -> u16
fn e_version(&self, endian: Self::Endian) -> u32
fn e_entry(&self, endian: Self::Endian) -> Self::Word
fn e_phoff(&self, endian: Self::Endian) -> Self::Word
fn e_shoff(&self, endian: Self::Endian) -> Self::Word
fn e_flags(&self, endian: Self::Endian) -> u32
fn e_ehsize(&self, endian: Self::Endian) -> u16
fn e_phentsize(&self, endian: Self::Endian) -> u16
fn e_phnum(&self, endian: Self::Endian) -> u16
fn e_shentsize(&self, endian: Self::Endian) -> u16
fn e_shnum(&self, endian: Self::Endian) -> u16
fn e_shstrndx(&self, endian: Self::Endian) -> u16
sourcefn is_supported(&self) -> bool
 
fn is_supported(&self) -> bool
Check that the ident field in the file header is a supported format. Read more
fn is_class_32(&self) -> bool
fn is_class_64(&self) -> bool
fn is_little_endian(&self) -> bool
fn is_big_endian(&self) -> bool
fn endian(&self) -> Result<Self::Endian>
sourcefn section_0<'data>(
    &self, 
    endian: Self::Endian, 
    data: Bytes<'data>
) -> Result<Option<&'data Self::SectionHeader>>
 
fn section_0<'data>(
    &self, 
    endian: Self::Endian, 
    data: Bytes<'data>
) -> Result<Option<&'data Self::SectionHeader>>
Return the first section header, if present. Read more
sourcefn phnum<'data>(
    &self, 
    endian: Self::Endian, 
    data: Bytes<'data>
) -> Result<usize>
 
fn phnum<'data>(
    &self, 
    endian: Self::Endian, 
    data: Bytes<'data>
) -> Result<usize>
Return the e_phnum field of the header. Handles extended values. Read more
sourcefn shnum<'data>(
    &self, 
    endian: Self::Endian, 
    data: Bytes<'data>
) -> Result<usize>
 
fn shnum<'data>(
    &self, 
    endian: Self::Endian, 
    data: Bytes<'data>
) -> Result<usize>
Return the e_shnum field of the header. Handles extended values. Read more
sourcefn shstrndx<'data>(
    &self, 
    endian: Self::Endian, 
    data: Bytes<'data>
) -> Result<u32>
 
fn shstrndx<'data>(
    &self, 
    endian: Self::Endian, 
    data: Bytes<'data>
) -> Result<u32>
Return the e_shstrndx field of the header. Handles extended values. Read more
sourcefn program_headers<'data>(
    &self, 
    endian: Self::Endian, 
    data: Bytes<'data>
) -> Result<&'data [Self::ProgramHeader]>
 
fn program_headers<'data>(
    &self, 
    endian: Self::Endian, 
    data: Bytes<'data>
) -> Result<&'data [Self::ProgramHeader]>
Return the slice of program headers. Read more
sourcefn section_headers<'data>(
    &self, 
    endian: Self::Endian, 
    data: Bytes<'data>
) -> Result<&'data [Self::SectionHeader]>
 
fn section_headers<'data>(
    &self, 
    endian: Self::Endian, 
    data: Bytes<'data>
) -> Result<&'data [Self::SectionHeader]>
Return the slice of section headers. Read more
sourcefn section_strings<'data>(
    &self, 
    endian: Self::Endian, 
    data: Bytes<'data>, 
    sections: &[Self::SectionHeader]
) -> Result<StringTable<'data>>
 
fn section_strings<'data>(
    &self, 
    endian: Self::Endian, 
    data: Bytes<'data>, 
    sections: &[Self::SectionHeader]
) -> Result<StringTable<'data>>
Return the string table for the section headers.
impl<E: Copy + Endian> Copy for FileHeader32<E>
impl<E: Endian> Pod for FileHeader32<E>
Auto Trait Implementations
impl<E> RefUnwindSafe for FileHeader32<E> where
    E: RefUnwindSafe, 
impl<E> Send for FileHeader32<E> where
    E: Send, 
impl<E> Sync for FileHeader32<E> where
    E: Sync, 
impl<E> Unpin for FileHeader32<E> where
    E: Unpin, 
impl<E> UnwindSafe for FileHeader32<E> where
    E: UnwindSafe, 
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
    T: ?Sized, 
 
impl<T> BorrowMut<T> for T where
    T: ?Sized, 
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
 
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
    T: Clone, 
 
impl<T> ToOwned for T where
    T: Clone, 
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
 
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
 
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more