Struct solana_rbpf::elf::Executable
source · [−]pub struct Executable<E: UserDefinedError, I: InstructionMeter> { /* private fields */ }
Expand description
Elf loader/relocator
Implementations
sourceimpl<E: UserDefinedError, I: InstructionMeter> Executable<E, I>
impl<E: UserDefinedError, I: InstructionMeter> Executable<E, I>
sourcepub fn get_config(&self) -> &Config
pub fn get_config(&self) -> &Config
Get the configuration settings
sourcepub fn get_ro_section(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
pub fn get_ro_section(&self) -> &[u8]ⓘNotable traits for &'_ [u8]impl<'_> Read for &'_ [u8]impl<'_> Write for &'_ mut [u8]
Get the concatenated read-only sections (including the text section)
sourcepub fn get_entrypoint_instruction_offset(&self) -> Result<usize, EbpfError<E>>
pub fn get_entrypoint_instruction_offset(&self) -> Result<usize, EbpfError<E>>
Get the entry point offset into the text section
sourcepub fn lookup_bpf_function(&self, hash: u32) -> Option<usize>
pub fn lookup_bpf_function(&self, hash: u32) -> Option<usize>
Get a symbol’s instruction offset
sourcepub fn get_syscall_registry(&self) -> &SyscallRegistry
pub fn get_syscall_registry(&self) -> &SyscallRegistry
Get the syscall registry
sourcepub fn get_compiled_program(&self) -> Option<&JitProgram<E, I>>
pub fn get_compiled_program(&self) -> Option<&JitProgram<E, I>>
Get the JIT compiled program
sourcepub fn jit_compile(executable: &mut Pin<Box<Self>>) -> Result<(), EbpfError<E>>
pub fn jit_compile(executable: &mut Pin<Box<Self>>) -> Result<(), EbpfError<E>>
JIT compile the executable
sourcepub fn report_unresolved_symbol(
&self,
insn_offset: usize
) -> Result<u64, EbpfError<E>>
pub fn report_unresolved_symbol(
&self,
insn_offset: usize
) -> Result<u64, EbpfError<E>>
Report information on a symbol that failed to be resolved
sourcepub fn get_function_symbols(&self) -> BTreeMap<usize, (u32, String)>
pub fn get_function_symbols(&self) -> BTreeMap<usize, (u32, String)>
Get syscalls and BPF functions (if debug symbols are not stripped)
sourcepub fn get_syscall_symbols(&self) -> &BTreeMap<u32, String>
pub fn get_syscall_symbols(&self) -> &BTreeMap<u32, String>
Get syscalls symbols
sourcepub fn new_from_text_bytes(
config: Config,
text_bytes: &[u8],
syscall_registry: SyscallRegistry,
bpf_functions: BTreeMap<u32, (usize, String)>
) -> Self
pub fn new_from_text_bytes(
config: Config,
text_bytes: &[u8],
syscall_registry: SyscallRegistry,
bpf_functions: BTreeMap<u32, (usize, String)>
) -> Self
Create from raw text section bytes (list of instructions)
sourcepub fn load(
config: Config,
bytes: &[u8],
syscall_registry: SyscallRegistry
) -> Result<Self, ElfError>
pub fn load(
config: Config,
bytes: &[u8],
syscall_registry: SyscallRegistry
) -> Result<Self, ElfError>
Fully loads an ELF, including validation and relocation
sourceimpl<E: UserDefinedError, I: 'static + InstructionMeter> Executable<E, I>
impl<E: UserDefinedError, I: 'static + InstructionMeter> Executable<E, I>
Static constructors for Executable
Trait Implementations
sourceimpl<E: Debug + UserDefinedError, I: Debug + InstructionMeter> Debug for Executable<E, I>
impl<E: Debug + UserDefinedError, I: Debug + InstructionMeter> Debug for Executable<E, I>
sourceimpl<E: PartialEq + UserDefinedError, I: PartialEq + InstructionMeter> PartialEq<Executable<E, I>> for Executable<E, I>
impl<E: PartialEq + UserDefinedError, I: PartialEq + InstructionMeter> PartialEq<Executable<E, I>> for Executable<E, I>
sourcefn eq(&self, other: &Executable<E, I>) -> bool
fn eq(&self, other: &Executable<E, I>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Executable<E, I>) -> bool
fn ne(&self, other: &Executable<E, I>) -> bool
This method tests for !=
.
impl<E: UserDefinedError, I: InstructionMeter> StructuralPartialEq for Executable<E, I>
Auto Trait Implementations
impl<E, I> RefUnwindSafe for Executable<E, I>
impl<E, I> Send for Executable<E, I>
impl<E, I> Sync for Executable<E, I>
impl<E, I> Unpin for Executable<E, I>
impl<E, I> !UnwindSafe for Executable<E, I>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more