Struct goblin::elf32::gnu_hash::GnuHash

source ·
pub struct GnuHash<'a> { /* private fields */ }
Expand description

A better hash table for the ELF used by GNU systems in GNU-compatible software.

Implementations§

source§

impl<'a> GnuHash<'a>

source

pub unsafe fn from_raw_table( hashtab: &'a [u8], dynsyms: &'a [Sym] ) -> Result<Self, &'static str>

Initialize a GnuHash from a pointer to .hash (or .gnu.hash) section and total number of dynamic symbols.

§Safety

This function creates a GnuHash directly from a raw pointer

source

pub fn find(&self, symbol: &str, dynstrtab: &Strtab<'_>) -> Option<&'a Sym>

Given a symbol, a hash of that symbol, a dynamic string table and a dynstrtab to cross-reference names, maybe returns a Sym.

source

pub fn find_with_hash( &self, symbol: &str, hash: u32, dynstrtab: &Strtab<'_> ) -> Option<&'a Sym>

This function will not check if the passed hash is really the hash of symbol

Trait Implementations§

source§

impl Debug for GnuHash<'_>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for GnuHash<'a>

§

impl<'a> RefUnwindSafe for GnuHash<'a>

§

impl<'a> Send for GnuHash<'a>

§

impl<'a> Sync for GnuHash<'a>

§

impl<'a> Unpin for GnuHash<'a>

§

impl<'a> UnwindSafe for GnuHash<'a>

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

§

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.