Skip to main content

RelocationLike

Trait RelocationLike 

Source
pub trait RelocationLike {
    // Required methods
    fn kind(&self) -> RelocationKind;
    fn reloc_target(&self) -> RelocationTarget;
    fn offset(&self) -> CodeOffset;
    fn addend(&self) -> Addend;

    // Provided method
    fn for_address(
        &self,
        start: usize,
        target_func_address: u64,
    ) -> (usize, u64) { ... }
}
Available on crate features core or std only.
Expand description

Any struct that acts like a Relocation.

Required Methods§

Provided Methods§

Source

fn for_address(&self, start: usize, target_func_address: u64) -> (usize, u64)

Given a function start address, provide the relocation relative to that address.

The function returns the relocation address and the delta.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§