Struct solana_rbpf::elf_parser::Elf64

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

The parsed structure of an ELF file

Implementations§

source§

impl<'a> Elf64<'a>

source

pub fn parse(elf_bytes: &'a [u8]) -> Result<Self, ElfParserError>

Parse from the given byte slice

source

pub fn file_header(&self) -> &Elf64Ehdr

Returns the file header.

source

pub fn program_header_table(&self) -> &[Elf64Phdr]

Returns the program header table.

source

pub fn section_header_table(&self) -> &[Elf64Shdr]

Returns the section header table.

source

pub fn dynamic_symbol_table(&self) -> Option<&[Elf64Sym]>

Returns the dynamic symbol table.

source

pub fn dynamic_relocations_table(&self) -> Option<&[Elf64Rel]>

Returns the dynamic relocations table.

source

pub fn get_string_in_section( &self, section_header: &Elf64Shdr, offset_in_section: Elf64Word, maximum_length: usize, ) -> Result<&'a [u8], ElfParserError>

Query a single string from a section which is marked as SHT_STRTAB

source

pub fn section_name( &self, sh_name: Elf64Word, ) -> Result<&'a [u8], ElfParserError>

Returns the string corresponding to the given sh_name

source

pub fn symbol_name( &self, st_name: Elf64Word, ) -> Result<&'a [u8], ElfParserError>

Returns the name of the st_name symbol

source

pub fn symbol_table(&self) -> Result<Option<&'a [Elf64Sym]>, ElfParserError>

Returns the symbol table

source

pub fn dynamic_symbol_name( &self, st_name: Elf64Word, ) -> Result<&'a [u8], ElfParserError>

Returns the name of the st_name dynamic symbol

source

pub fn get_symbol_table_of_section( &self, section_header: &Elf64Shdr, ) -> Result<&'a [Elf64Sym], ElfParserError>

Returns the symbol table of a section which is marked as SHT_SYMTAB

source

pub fn slice_from_program_header<T: 'static>( &self, _: &Elf64Phdr, ) -> Result<&'a [T], ElfParserError>

Returns the &[T] contained in the data described by the given program header

source

pub fn slice_from_section_header<T: 'static>( &self, _: &Elf64Shdr, ) -> Result<&'a [T], ElfParserError>

Returns the &[T] contained in the section data described by the given section header

Trait Implementations§

source§

impl<'a> Debug for Elf64<'a>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Elf64<'a>

§

impl<'a> RefUnwindSafe for Elf64<'a>

§

impl<'a> Send for Elf64<'a>

§

impl<'a> Sync for Elf64<'a>

§

impl<'a> Unpin for Elf64<'a>

§

impl<'a> UnwindSafe for Elf64<'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> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V