Struct object::read::elf::SymbolTable
source · pub struct SymbolTable<'data, Elf: FileHeader, R = &'data [u8]>where
R: ReadRef<'data>,{
section: SectionIndex,
string_section: SectionIndex,
shndx_section: SectionIndex,
symbols: &'data [Elf::Sym],
strings: StringTable<'data, R>,
shndx: &'data [U32<Elf::Endian>],
}
Expand description
A table of symbol entries in an ELF file.
Also includes the string table used for the symbol names.
Returned by SectionTable::symbols
.
Fields§
§section: SectionIndex
§string_section: SectionIndex
§shndx_section: SectionIndex
§symbols: &'data [Elf::Sym]
§strings: StringTable<'data, R>
§shndx: &'data [U32<Elf::Endian>]
Implementations§
source§impl<'data, Elf: FileHeader, R: ReadRef<'data>> SymbolTable<'data, Elf, R>
impl<'data, Elf: FileHeader, R: ReadRef<'data>> SymbolTable<'data, Elf, R>
sourcepub fn parse(
endian: Elf::Endian,
data: R,
sections: &SectionTable<'data, Elf, R>,
section_index: SectionIndex,
section: &Elf::SectionHeader,
) -> Result<SymbolTable<'data, Elf, R>>
pub fn parse( endian: Elf::Endian, data: R, sections: &SectionTable<'data, Elf, R>, section_index: SectionIndex, section: &Elf::SectionHeader, ) -> Result<SymbolTable<'data, Elf, R>>
Parse the given symbol table section.
sourcepub fn section(&self) -> SectionIndex
pub fn section(&self) -> SectionIndex
Return the section index of this symbol table.
sourcepub fn shndx_section(&self) -> SectionIndex
pub fn shndx_section(&self) -> SectionIndex
Return the section index of the shndx table.
sourcepub fn string_section(&self) -> SectionIndex
pub fn string_section(&self) -> SectionIndex
Return the section index of the linked string table.
sourcepub fn strings(&self) -> StringTable<'data, R>
pub fn strings(&self) -> StringTable<'data, R>
Return the string table used for the symbol names.
sourcepub fn iter(&self) -> Iter<'data, Elf::Sym>
pub fn iter(&self) -> Iter<'data, Elf::Sym>
Iterate over the symbols.
This includes the null symbol at index 0, which you will usually need to skip.
sourcepub fn enumerate(&self) -> impl Iterator<Item = (SymbolIndex, &'data Elf::Sym)>
pub fn enumerate(&self) -> impl Iterator<Item = (SymbolIndex, &'data Elf::Sym)>
Iterate over the symbols and their indices.
This includes the null symbol at index 0, which you will usually need to skip.
sourcepub fn symbol(&self, index: SymbolIndex) -> Result<&'data Elf::Sym>
pub fn symbol(&self, index: SymbolIndex) -> Result<&'data Elf::Sym>
Get the symbol at the given index.
Returns an error for null entry at index 0.
sourcepub fn shndx(&self, endian: Elf::Endian, index: SymbolIndex) -> Option<u32>
pub fn shndx(&self, endian: Elf::Endian, index: SymbolIndex) -> Option<u32>
Return the extended section index for the given symbol if present.
sourcepub fn symbol_section(
&self,
endian: Elf::Endian,
symbol: &Elf::Sym,
index: SymbolIndex,
) -> Result<Option<SectionIndex>>
pub fn symbol_section( &self, endian: Elf::Endian, symbol: &Elf::Sym, index: SymbolIndex, ) -> Result<Option<SectionIndex>>
Return the section index for the given symbol.
This uses the extended section index if present.
Trait Implementations§
source§impl<'data, Elf: Clone + FileHeader, R> Clone for SymbolTable<'data, Elf, R>
impl<'data, Elf: Clone + FileHeader, R> Clone for SymbolTable<'data, Elf, R>
source§fn clone(&self) -> SymbolTable<'data, Elf, R>
fn clone(&self) -> SymbolTable<'data, Elf, R>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'data, Elf: Debug + FileHeader, R> Debug for SymbolTable<'data, Elf, R>
impl<'data, Elf: Debug + FileHeader, R> Debug for SymbolTable<'data, Elf, R>
source§impl<'data, Elf: FileHeader, R: ReadRef<'data>> Default for SymbolTable<'data, Elf, R>
impl<'data, Elf: FileHeader, R: ReadRef<'data>> Default for SymbolTable<'data, Elf, R>
impl<'data, Elf: Copy + FileHeader, R> Copy for SymbolTable<'data, Elf, R>
Auto Trait Implementations§
impl<'data, Elf, R> Freeze for SymbolTable<'data, Elf, R>where
R: Freeze,
impl<'data, Elf, R> RefUnwindSafe for SymbolTable<'data, Elf, R>where
<Elf as FileHeader>::Sym: RefUnwindSafe,
R: RefUnwindSafe,
<Elf as FileHeader>::Endian: RefUnwindSafe,
impl<'data, Elf, R> Send for SymbolTable<'data, Elf, R>
impl<'data, Elf, R> Sync for SymbolTable<'data, Elf, R>
impl<'data, Elf, R> Unpin for SymbolTable<'data, Elf, R>where
R: Unpin,
impl<'data, Elf, R> UnwindSafe for SymbolTable<'data, Elf, R>where
<Elf as FileHeader>::Sym: RefUnwindSafe,
R: UnwindSafe,
<Elf as FileHeader>::Endian: RefUnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)