Struct solana_rbpf::elf::EBpfElf[][src]

pub struct EBpfElf<E: UserDefinedError, I: InstructionMeter> { /* fields omitted */ }

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]

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]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

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