Struct object::read::elf::hash::HashTable

source ·
pub struct HashTable<'data, Elf: FileHeader> {
    buckets: &'data [U32<Elf::Endian>],
    chains: &'data [U32<Elf::Endian>],
}
Expand description

A SysV symbol hash table in an ELF file.

Returned by SectionHeader::hash.

Fields§

§buckets: &'data [U32<Elf::Endian>]§chains: &'data [U32<Elf::Endian>]

Implementations§

source§

impl<'data, Elf: FileHeader> HashTable<'data, Elf>

source

pub fn parse(endian: Elf::Endian, data: &'data [u8]) -> Result<Self>

Parse a SysV hash table.

data should be from an elf::SHT_HASH section, or from a segment pointed to via the elf::DT_HASH entry.

The header is read at offset 0 in the given data.

source

pub fn symbol_table_length(&self) -> u32

Return the symbol table length.

source

fn bucket(&self, endian: Elf::Endian, hash: u32) -> SymbolIndex

source

fn chain(&self, endian: Elf::Endian, index: SymbolIndex) -> SymbolIndex

source

pub fn find<R: ReadRef<'data>>( &self, endian: Elf::Endian, name: &[u8], hash: u32, version: Option<&Version<'_>>, symbols: &SymbolTable<'data, Elf, R>, versions: &VersionTable<'data, Elf>, ) -> Option<(SymbolIndex, &'data Elf::Sym)>

Use the hash table to find the symbol table entry with the given name, hash and version.

Trait Implementations§

source§

impl<'data, Elf: Debug + FileHeader> Debug for HashTable<'data, Elf>
where Elf::Endian: Debug,

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'data, Elf> Freeze for HashTable<'data, Elf>

§

impl<'data, Elf> RefUnwindSafe for HashTable<'data, Elf>
where <Elf as FileHeader>::Endian: RefUnwindSafe,

§

impl<'data, Elf> Send for HashTable<'data, Elf>
where <Elf as FileHeader>::Endian: Sync,

§

impl<'data, Elf> Sync for HashTable<'data, Elf>
where <Elf as FileHeader>::Endian: Sync,

§

impl<'data, Elf> Unpin for HashTable<'data, Elf>

§

impl<'data, Elf> UnwindSafe for HashTable<'data, Elf>
where <Elf as FileHeader>::Endian: RefUnwindSafe,

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, U> TryFrom<U> for T
where U: Into<T>,

source§

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>,

source§

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.