Skip to main content

RelocationEvent

Struct RelocationEvent 

Source
pub struct RelocationEvent<'a, D: Send + Sync + 'static, Arch: RelocationArch = NativeArch, R: RegionAccess = HostRegion, Tls: TlsResolver<Arch> = (), H = HashTable<<Arch as RelocationArch>::Layout>> { /* private fields */ }
Expand description

Context passed to relocation observer hooks.

This struct provides access to the relocation entry, the module being relocated, and the current symbol resolution scope.

Implementations§

Source§

impl<'a, D: Send + Sync + 'static, Arch: RelocationArch, R: RegionAccess, Tls: TlsResolver<Arch>, H> RelocationEvent<'a, D, Arch, R, Tls, H>

Source

pub fn rel(&self) -> &ElfRelType<Arch>

Access the relocation entry.

Source

pub fn lib(&self) -> &ElfCore<D, Arch, R, Tls>

Access the core component where the relocation appears.

Source

pub fn scope(&self) -> &LocalScope<Arch, Tls>

Returns the local lookup scope.

bind_symdef also searches the linker-global scope active for this relocation.

Source

pub fn lazy(&self) -> Option<LazyValues>

Returns values supplied by the lazy binder, when active.

Source

pub fn symbol(&self, r_sym: usize) -> SymbolEntry<'a, Arch::Layout>

Access a symbol table entry by index for this relocation context.

Source

pub fn relocation_symbol(&self) -> Option<SymbolEntry<'a, Arch::Layout>>

Access the symbol referenced by the current relocation, if it has one.

Source

pub fn bind_symdef(&mut self, r_sym: usize) -> Option<SymDef<'_, Arch, Tls>>

Finds a symbol definition and records its provider as a runtime dependency.

Auto Trait Implementations§

§

impl<'a, D, Arch = X86_64Arch, R = HostRegion, Tls = (), H = HashTable<<Arch as RelocationArch>::Layout>> !RefUnwindSafe for RelocationEvent<'a, D, Arch, R, Tls, H>

§

impl<'a, D, Arch = X86_64Arch, R = HostRegion, Tls = (), H = HashTable<<Arch as RelocationArch>::Layout>> !UnwindSafe for RelocationEvent<'a, D, Arch, R, Tls, H>

§

impl<'a, D, Arch, R, Tls, H> Freeze for RelocationEvent<'a, D, Arch, R, Tls, H>
where &'a ElfCore<D, Arch, R, Tls>: Freeze, &'a <Arch as RelocationArch>::Relocation: Freeze, &'a SymbolResolver<'a, Arch, Tls>: Freeze, SymbolTableView<'a, <Arch as RelocationArch>::Layout, H>: Freeze,

§

impl<'a, D, Arch, R, Tls, H> Send for RelocationEvent<'a, D, Arch, R, Tls, H>
where &'a ElfCore<D, Arch, R, Tls>: Send, &'a <Arch as RelocationArch>::Relocation: Send, &'a SymbolResolver<'a, Arch, Tls>: Send, SymbolTableView<'a, <Arch as RelocationArch>::Layout, H>: Send,

§

impl<'a, D, Arch, R, Tls, H> Sync for RelocationEvent<'a, D, Arch, R, Tls, H>
where &'a ElfCore<D, Arch, R, Tls>: Sync, &'a <Arch as RelocationArch>::Relocation: Sync, &'a SymbolResolver<'a, Arch, Tls>: Sync, SymbolTableView<'a, <Arch as RelocationArch>::Layout, H>: Sync,

§

impl<'a, D, Arch, R, Tls, H> Unpin for RelocationEvent<'a, D, Arch, R, Tls, H>
where &'a ElfCore<D, Arch, R, Tls>: Unpin, &'a <Arch as RelocationArch>::Relocation: Unpin, &'a SymbolResolver<'a, Arch, Tls>: Unpin, SymbolTableView<'a, <Arch as RelocationArch>::Layout, H>: Unpin,

§

impl<'a, D, Arch, R, Tls, H> UnsafeUnpin for RelocationEvent<'a, D, Arch, R, Tls, H>
where &'a ElfCore<D, Arch, R, Tls>: UnsafeUnpin, &'a <Arch as RelocationArch>::Relocation: UnsafeUnpin, &'a SymbolResolver<'a, Arch, Tls>: UnsafeUnpin, SymbolTableView<'a, <Arch as RelocationArch>::Layout, H>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.