pub struct LazyRuntime<Arch: RelocationArch> { /* private fields */ }Expand description
Public facade over Relink’s lazy binding runtime state.
This handle lets custom lazy binders inspect PLT relocation context and reuse Relink’s symbol lookup / jump-slot writeback without exposing the internal core runtime layout.
Implementations§
Source§impl<Arch: RelocationArch> LazyRuntime<Arch>
impl<Arch: RelocationArch> LazyRuntime<Arch>
Sourcepub unsafe fn from_runtime(runtime: VmAddr) -> Self
pub unsafe fn from_runtime(runtime: VmAddr) -> Self
Rebuilds a lazy runtime handle from a context entry passed to a resolver.
§Safety
runtime must be a value previously returned by Self::runtime for a
live module with the same Arch type.
Sourcepub fn runtime(&self) -> VmAddr
pub fn runtime(&self) -> VmAddr
Returns the native resolver context entry for this runtime handle.
Sourcepub fn memory(&self) -> &dyn ImageMemory
pub fn memory(&self) -> &dyn ImageMemory
Returns the mapped image memory owned by the module.
Sourcepub fn plt_relocation(&self, rela_idx: usize) -> Option<LazyPltReloc<'_, Arch>>
pub fn plt_relocation(&self, rela_idx: usize) -> Option<LazyPltReloc<'_, Arch>>
Returns one PLT relocation by lazy relocation index.
Sourcepub fn lookup_symbol(
&self,
symbol: SymbolEntry<'_, Arch::Layout>,
) -> Result<Option<VmAddr>>
pub fn lookup_symbol( &self, symbol: SymbolEntry<'_, Arch::Layout>, ) -> Result<Option<VmAddr>>
Looks up a symbol through Relink’s normal lazy binding lookup path.
Sourcepub fn write_jump_slot(
&self,
reloc: &LazyPltReloc<'_, Arch>,
value: VmAddr,
) -> Result<()>
pub fn write_jump_slot( &self, reloc: &LazyPltReloc<'_, Arch>, value: VmAddr, ) -> Result<()>
Writes a resolved address into the relocation’s jump slot.
Trait Implementations§
Source§impl<Arch: RelocationArch> Clone for LazyRuntime<Arch>
impl<Arch: RelocationArch> Clone for LazyRuntime<Arch>
impl<Arch: RelocationArch> Copy for LazyRuntime<Arch>
Auto Trait Implementations§
impl<Arch> !RefUnwindSafe for LazyRuntime<Arch>
impl<Arch> !Send for LazyRuntime<Arch>
impl<Arch> !Sync for LazyRuntime<Arch>
impl<Arch> !UnwindSafe for LazyRuntime<Arch>
impl<Arch> Freeze for LazyRuntime<Arch>
impl<Arch> Unpin for LazyRuntime<Arch>
impl<Arch> UnsafeUnpin for LazyRuntime<Arch>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more