Struct solana_rbpf::elf::EBpfElf [−][src]
Elf loader/relocator
Implementations
impl<'a, E: UserDefinedError, I: InstructionMeter> EBpfElf<E, I>
[src]
pub fn new_from_text_bytes(config: Config, text_bytes: &[u8]) -> Self
[src]
Create from raw text section bytes (list of instructions)
pub fn load(config: Config, bytes: &[u8]) -> Result<Self, ElfError>
[src]
Fully loads an ELF, including validation and relocation
pub fn fixup_relative_calls(
calls: &mut HashMap<u32, usize>,
elf_bytes: &mut [u8]
) -> Result<(), ElfError>
[src]
calls: &mut HashMap<u32, usize>,
elf_bytes: &mut [u8]
) -> Result<(), ElfError>
Fix-ups relative calls
pub fn validate(elf: &Elf<'_>, elf_bytes: &[u8]) -> Result<(), ElfError>
[src]
Validates the ELF
Trait Implementations
impl<E: Debug + UserDefinedError, I: Debug + InstructionMeter> Debug for EBpfElf<E, I>
[src]
impl<E: UserDefinedError, I: InstructionMeter> Executable<E, I> for EBpfElf<E, I>
[src]
fn get_config(&self) -> &Config
[src]
Get the configuration settings
fn get_text_bytes(&self) -> Result<(u64, &[u8]), EbpfError<E>>
[src]
Get the .text section virtual address and bytes
fn get_ro_sections(&self) -> Result<Vec<(u64, &[u8])>, EbpfError<E>>
[src]
Get a vector of virtual addresses for each read-only section
fn get_entrypoint_instruction_offset(&self) -> Result<usize, EbpfError<E>>
[src]
Get the entry point offset into the text section
fn register_bpf_function(&mut self, hash: u32, pc: usize)
[src]
Set a symbol’s instruction offset
fn lookup_bpf_function(&self, hash: u32) -> Option<&usize>
[src]
Get a symbol’s instruction offset
fn get_syscall_registry(&self) -> &SyscallRegistry
[src]
Get the syscall registry
fn set_syscall_registry(&mut self, syscall_registry: SyscallRegistry)
[src]
Set (overwrite) the syscall registry
fn get_compiled_program(&self) -> Option<&JitProgram<E, I>>
[src]
Get the JIT compiled program
fn jit_compile(&mut self) -> Result<(), EbpfError<E>>
[src]
JIT compile the executable
fn report_unresolved_symbol(
&self,
insn_offset: usize
) -> Result<u64, EbpfError<E>>
[src]
&self,
insn_offset: usize
) -> Result<u64, EbpfError<E>>
Report information on a symbol that failed to be resolved
fn get_symbols(&self) -> (HashMap<u32, String>, HashMap<usize, (String, usize)>)
[src]
Get syscalls and BPF functions (if debug symbols are not stripped)
impl<E: PartialEq + UserDefinedError, I: PartialEq + InstructionMeter> PartialEq<EBpfElf<E, I>> for EBpfElf<E, I>
[src]
impl<E: UserDefinedError, I: InstructionMeter> StructuralPartialEq for EBpfElf<E, I>
[src]
Auto Trait Implementations
impl<E, I> RefUnwindSafe for EBpfElf<E, I>
impl<E, I> Send for EBpfElf<E, I>
impl<E, I> Sync for EBpfElf<E, I>
impl<E, I> Unpin for EBpfElf<E, I>
impl<E, I> !UnwindSafe for EBpfElf<E, I>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
[src]
V: MultiLane<T>,