pub struct ElfFile<'data, Elf: FileHeader> { /* private fields */ }Expand description
A partially parsed ELF file.
Most of the functionality of this type is provided by the Object trait implementation.
Implementations
sourceimpl<'data, Elf: FileHeader> ElfFile<'data, Elf>
 
impl<'data, Elf: FileHeader> ElfFile<'data, Elf>
Trait Implementations
sourceimpl<'data, Elf: Debug + FileHeader> Debug for ElfFile<'data, Elf> where
    Elf::Endian: Debug,
    Elf::ProgramHeader: Debug, 
 
impl<'data, Elf: Debug + FileHeader> Debug for ElfFile<'data, Elf> where
    Elf::Endian: Debug,
    Elf::ProgramHeader: Debug, 
sourceimpl<'data, 'file, Elf> Object<'data, 'file> for ElfFile<'data, Elf> where
    'data: 'file,
    Elf: FileHeader, 
 
impl<'data, 'file, Elf> Object<'data, 'file> for ElfFile<'data, Elf> where
    'data: 'file,
    Elf: FileHeader, 
type Segment = ElfSegment<'data, 'file, Elf>
type Segment = ElfSegment<'data, 'file, Elf>
A segment in the object file.
type SegmentIterator = ElfSegmentIterator<'data, 'file, Elf>
type SegmentIterator = ElfSegmentIterator<'data, 'file, Elf>
An iterator over the segments in the object file.
type Section = ElfSection<'data, 'file, Elf>
type Section = ElfSection<'data, 'file, Elf>
A section in the object file.
type SectionIterator = ElfSectionIterator<'data, 'file, Elf>
type SectionIterator = ElfSectionIterator<'data, 'file, Elf>
An iterator over the sections in the object file.
type ComdatIterator = ElfComdatIterator<'data, 'file, Elf>
type ComdatIterator = ElfComdatIterator<'data, 'file, Elf>
An iterator over the COMDAT section groups in the object file.
type SymbolIterator = ElfSymbolIterator<'data, 'file, Elf>
type SymbolIterator = ElfSymbolIterator<'data, 'file, Elf>
An iterator over symbols in the object file.
type SymbolTable = ElfSymbolTable<'data, 'file, Elf>
type SymbolTable = ElfSymbolTable<'data, 'file, Elf>
A symbol table in the object file.
type DynamicRelocationIterator = ElfDynamicRelocationIterator<'data, 'file, Elf>
type DynamicRelocationIterator = ElfDynamicRelocationIterator<'data, 'file, Elf>
An iterator over dynamic relocations in the file. Read more
sourcefn architecture(&self) -> Architecture
 
fn architecture(&self) -> Architecture
Get the architecture type of the file.
sourcefn is_little_endian(&self) -> bool
 
fn is_little_endian(&self) -> bool
Return true if the file is little endian, false if it is big endian.
sourcefn segments(&'file self) -> ElfSegmentIterator<'data, 'file, Elf>ⓘNotable traits for ElfSegmentIterator<'data, 'file, Elf>impl<'data, 'file, Elf: FileHeader> Iterator for ElfSegmentIterator<'data, 'file, Elf>    type Item = ElfSegment<'data, 'file, Elf>;
 
fn segments(&'file self) -> ElfSegmentIterator<'data, 'file, Elf>ⓘNotable traits for ElfSegmentIterator<'data, 'file, Elf>impl<'data, 'file, Elf: FileHeader> Iterator for ElfSegmentIterator<'data, 'file, Elf>    type Item = ElfSegment<'data, 'file, Elf>;
Get an iterator over the segments in the file.
sourcefn section_by_name(
    &'file self, 
    section_name: &str
) -> Option<ElfSection<'data, 'file, Elf>>
 
fn section_by_name(
    &'file self, 
    section_name: &str
) -> Option<ElfSection<'data, 'file, Elf>>
Get the section named section_name, if such a section exists. Read more
sourcefn section_by_index(
    &'file self, 
    index: SectionIndex
) -> Result<ElfSection<'data, 'file, Elf>>
 
fn section_by_index(
    &'file self, 
    index: SectionIndex
) -> Result<ElfSection<'data, 'file, Elf>>
Get the section at the given index. Read more
sourcefn sections(&'file self) -> ElfSectionIterator<'data, 'file, Elf>ⓘNotable traits for ElfSectionIterator<'data, 'file, Elf>impl<'data, 'file, Elf: FileHeader> Iterator for ElfSectionIterator<'data, 'file, Elf>    type Item = ElfSection<'data, 'file, Elf>;
 
fn sections(&'file self) -> ElfSectionIterator<'data, 'file, Elf>ⓘNotable traits for ElfSectionIterator<'data, 'file, Elf>impl<'data, 'file, Elf: FileHeader> Iterator for ElfSectionIterator<'data, 'file, Elf>    type Item = ElfSection<'data, 'file, Elf>;
Get an iterator over the sections in the file.
sourcefn comdats(&'file self) -> ElfComdatIterator<'data, 'file, Elf>ⓘNotable traits for ElfComdatIterator<'data, 'file, Elf>impl<'data, 'file, Elf: FileHeader> Iterator for ElfComdatIterator<'data, 'file, Elf>    type Item = ElfComdat<'data, 'file, Elf>;
 
fn comdats(&'file self) -> ElfComdatIterator<'data, 'file, Elf>ⓘNotable traits for ElfComdatIterator<'data, 'file, Elf>impl<'data, 'file, Elf: FileHeader> Iterator for ElfComdatIterator<'data, 'file, Elf>    type Item = ElfComdat<'data, 'file, Elf>;
Get an iterator over the COMDAT section groups in the file.
sourcefn symbol_by_index(
    &'file self, 
    index: SymbolIndex
) -> Result<ElfSymbol<'data, 'file, Elf>>
 
fn symbol_by_index(
    &'file self, 
    index: SymbolIndex
) -> Result<ElfSymbol<'data, 'file, Elf>>
Get the debugging symbol at the given index. Read more
sourcefn symbols(&'file self) -> ElfSymbolIterator<'data, 'file, Elf>ⓘNotable traits for ElfSymbolIterator<'data, 'file, Elf>impl<'data, 'file, Elf: FileHeader> Iterator for ElfSymbolIterator<'data, 'file, Elf>    type Item = ElfSymbol<'data, 'file, Elf>;
 
fn symbols(&'file self) -> ElfSymbolIterator<'data, 'file, Elf>ⓘNotable traits for ElfSymbolIterator<'data, 'file, Elf>impl<'data, 'file, Elf: FileHeader> Iterator for ElfSymbolIterator<'data, 'file, Elf>    type Item = ElfSymbol<'data, 'file, Elf>;
Get an iterator over the debugging symbols in the file. Read more
sourcefn symbol_table(&'file self) -> Option<ElfSymbolTable<'data, 'file, Elf>>
 
fn symbol_table(&'file self) -> Option<ElfSymbolTable<'data, 'file, Elf>>
Get the symbol table, if any.
sourcefn dynamic_symbols(&'file self) -> ElfSymbolIterator<'data, 'file, Elf>ⓘNotable traits for ElfSymbolIterator<'data, 'file, Elf>impl<'data, 'file, Elf: FileHeader> Iterator for ElfSymbolIterator<'data, 'file, Elf>    type Item = ElfSymbol<'data, 'file, Elf>;
 
fn dynamic_symbols(&'file self) -> ElfSymbolIterator<'data, 'file, Elf>ⓘNotable traits for ElfSymbolIterator<'data, 'file, Elf>impl<'data, 'file, Elf: FileHeader> Iterator for ElfSymbolIterator<'data, 'file, Elf>    type Item = ElfSymbol<'data, 'file, Elf>;
Get an iterator over the dynamic linking symbols in the file. Read more
sourcefn dynamic_symbol_table(
    &'file self
) -> Option<ElfSymbolTable<'data, 'file, Elf>>
 
fn dynamic_symbol_table(
    &'file self
) -> Option<ElfSymbolTable<'data, 'file, Elf>>
Get the dynamic linking symbol table, if any. Read more
sourcefn dynamic_relocations(
    &'file self
) -> Option<ElfDynamicRelocationIterator<'data, 'file, Elf>>
 
fn dynamic_relocations(
    &'file self
) -> Option<ElfDynamicRelocationIterator<'data, 'file, Elf>>
Get the dynamic relocations for this file. Read more
sourcefn has_debug_symbols(&self) -> bool
 
fn has_debug_symbols(&self) -> bool
Return true if the file contains debug information sections, false if not.
sourcefn build_id(&self) -> Result<Option<&'data [u8]>>
 
fn build_id(&self) -> Result<Option<&'data [u8]>>
The build ID from an ELF NT_GNU_BUILD_ID note.
sourcefn gnu_debuglink(&self) -> Result<Option<(&'data [u8], u32)>>
 
fn gnu_debuglink(&self) -> Result<Option<(&'data [u8], u32)>>
The filename and CRC from a .gnu_debuglink section.
sourcefn endianness(&self) -> Endianness
 
fn endianness(&self) -> Endianness
Get the endianness of the file.
sourcefn symbol_map(&'file self) -> SymbolMap<SymbolMapName<'data>>
 
fn symbol_map(&'file self) -> SymbolMap<SymbolMapName<'data>>
Construct a map from addresses to symbol names. Read more
sourcefn object_map(&'file self) -> ObjectMap<'data>
 
fn object_map(&'file self) -> ObjectMap<'data>
Construct a map from addresses to symbol names and object file names. Read more
Auto Trait Implementations
impl<'data, Elf> RefUnwindSafe for ElfFile<'data, Elf> where
    Elf: RefUnwindSafe,
    <Elf as FileHeader>::Endian: RefUnwindSafe,
    <Elf as FileHeader>::ProgramHeader: RefUnwindSafe,
    <Elf as FileHeader>::SectionHeader: RefUnwindSafe,
    <Elf as FileHeader>::Sym: RefUnwindSafe, 
impl<'data, Elf> Send for ElfFile<'data, Elf> where
    Elf: Sync,
    <Elf as FileHeader>::Endian: Send,
    <Elf as FileHeader>::ProgramHeader: Sync,
    <Elf as FileHeader>::SectionHeader: Sync,
    <Elf as FileHeader>::Sym: Sync, 
impl<'data, Elf> Sync for ElfFile<'data, Elf> where
    Elf: Sync,
    <Elf as FileHeader>::Endian: Sync,
    <Elf as FileHeader>::ProgramHeader: Sync,
    <Elf as FileHeader>::SectionHeader: Sync,
    <Elf as FileHeader>::Sym: Sync, 
impl<'data, Elf> Unpin for ElfFile<'data, Elf> where
    <Elf as FileHeader>::Endian: Unpin, 
impl<'data, Elf> UnwindSafe for ElfFile<'data, Elf> where
    Elf: RefUnwindSafe,
    <Elf as FileHeader>::Endian: UnwindSafe,
    <Elf as FileHeader>::ProgramHeader: RefUnwindSafe,
    <Elf as FileHeader>::SectionHeader: RefUnwindSafe,
    <Elf as FileHeader>::Sym: RefUnwindSafe, 
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