[][src]Enum solana_rbpf::elf::BPFRelocationType

pub enum BPFRelocationType {
    R_BPF_NONE,
    R_BPF_64_RELATIVE,
    R_BPF_64_32,
}

BPF relocation types.

Variants

R_BPF_NONE

No relocation, placeholder

R_BPF_64_RELATIVE

64 bit relocation of a ldxdw instruction. The ldxdw instruction occupies two instruction slots. The 64-bit address to load from is split into the 32-bit imm field of each slot. The first slot's pre-relocation imm field contains the virtual address (typically same as the file offset) of the location to load. Relocation involves calculating the post-load 64-bit physical address referenced by the imm field and writing that physical address back into the imm fields of the ldxdw instruction.

R_BPF_64_32

Relocation of a call instruction.
The existing imm field contains either an offset of the instruction to jump to (think local function call) or a special value of "-1". If -1 the symbol must be looked up in the symbol table. The relocation entry contains the symbol number to call. In order to support both local jumps and calling external symbols a 32-bit hash is computed and stored in the the call instruction's 32-bit imm field. The hash is used later to look up the 64-bit address to jump to. In the case of a local jump the hash is calculated using the current program counter and in the case of a symbol the hash is calculated using the name of the symbol.

Trait Implementations

impl Clone for BPFRelocationType[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Copy for BPFRelocationType[src]

impl PartialEq<BPFRelocationType> for BPFRelocationType[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests for !=.

impl Debug for BPFRelocationType[src]

Auto Trait Implementations

Blanket Implementations

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]