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>
impl<'a> Elf64<'a>
sourcepub fn parse(elf_bytes: &'a [u8]) -> Result<Self, ElfParserError>
pub fn parse(elf_bytes: &'a [u8]) -> Result<Self, ElfParserError>
Parse from the given byte slice
sourcepub fn file_header(&self) -> &Elf64Ehdr
pub fn file_header(&self) -> &Elf64Ehdr
Returns the file header.
sourcepub fn program_header_table(&self) -> &[Elf64Phdr]
pub fn program_header_table(&self) -> &[Elf64Phdr]
Returns the program header table.
sourcepub fn section_header_table(&self) -> &[Elf64Shdr]
pub fn section_header_table(&self) -> &[Elf64Shdr]
Returns the section header table.
sourcepub fn dynamic_symbol_table(&self) -> Option<&[Elf64Sym]>
pub fn dynamic_symbol_table(&self) -> Option<&[Elf64Sym]>
Returns the dynamic symbol table.
sourcepub fn dynamic_relocations_table(&self) -> Option<&[Elf64Rel]>
pub fn dynamic_relocations_table(&self) -> Option<&[Elf64Rel]>
Returns the dynamic relocations table.
sourcepub fn get_string_in_section(
&self,
section_header: &Elf64Shdr,
offset_in_section: Elf64Word,
maximum_length: usize,
) -> Result<&'a [u8], ElfParserError>
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
sourcepub fn section_name(
&self,
sh_name: Elf64Word,
) -> Result<&'a [u8], ElfParserError>
pub fn section_name( &self, sh_name: Elf64Word, ) -> Result<&'a [u8], ElfParserError>
Returns the string corresponding to the given sh_name
sourcepub fn symbol_name(
&self,
st_name: Elf64Word,
) -> Result<&'a [u8], ElfParserError>
pub fn symbol_name( &self, st_name: Elf64Word, ) -> Result<&'a [u8], ElfParserError>
Returns the name of the st_name
symbol
sourcepub fn symbol_table(&self) -> Result<Option<&'a [Elf64Sym]>, ElfParserError>
pub fn symbol_table(&self) -> Result<Option<&'a [Elf64Sym]>, ElfParserError>
Returns the symbol table
sourcepub fn dynamic_symbol_name(
&self,
st_name: Elf64Word,
) -> Result<&'a [u8], ElfParserError>
pub fn dynamic_symbol_name( &self, st_name: Elf64Word, ) -> Result<&'a [u8], ElfParserError>
Returns the name of the st_name
dynamic symbol
sourcepub fn get_symbol_table_of_section(
&self,
section_header: &Elf64Shdr,
) -> Result<&'a [Elf64Sym], ElfParserError>
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
sourcepub fn slice_from_program_header<T: 'static>(
&self,
_: &Elf64Phdr,
) -> Result<&'a [T], ElfParserError>
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
sourcepub fn slice_from_section_header<T: 'static>(
&self,
_: &Elf64Shdr,
) -> Result<&'a [T], ElfParserError>
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§
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> 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
Mutably borrows from an owned value. Read more
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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