Skip to main content

RelocatorRun

Struct RelocatorRun 

Source
pub struct RelocatorRun<'cfg, T, Arch: RelocationArch = NativeArch, Obs = (), Tls: TlsResolver<Arch> = (), Binder = ()> { /* private fields */ }
Expand description

Per-image relocation run state.

A run owns the raw image being relocated and the scope being assembled for that image. It consumes itself when relocate is called.

Implementations§

Source§

impl<'cfg, T, Arch, Obs, Tls, Binder> RelocatorRun<'cfg, T, Arch, Obs, Tls, Binder>
where Arch: RelocationArch, Tls: TlsResolver<Arch>, Binder: LazyBinder<Arch>,

Source

pub fn observer<NewObs>( self, observer: NewObs, ) -> RelocatorRun<'cfg, T, Arch, NewObs, Tls, Binder>
where NewObs: RelocationObserver<Arch>,

Sets the runtime-linker observer used during relocation.

Source

pub fn binding(self, binding: BindingMode) -> Self

Overrides the relocation binding mode.

Source

pub fn lookup_order(self, order: LookupOrder) -> Self

Sets precedence between the local and context-global lookup scopes.

Source

pub fn global_scope(self, global: &GlobalScope<Arch, Tls>) -> Self

Uses a LinkContext global symbol scope.

The shared handle is retained only for the relocation run. Deferred binding stores a weak reference and therefore does not keep the context or unrelated global modules alive.

Source

pub fn modules<I, R>(self, modules: I) -> Self
where I: IntoIterator<Item = R>, R: Into<ModuleHandle<Arch, Tls>>,

Uses the same ordered modules for eager and deferred symbol lookup.

Source

pub fn local_scope(self, scope: LocalScope<Arch, Tls>) -> Self

Replaces the complete eager and deferred symbol lookup scope.

Source§

impl<'cfg, T, Arch, Obs, Tls, Binder> RelocatorRun<'cfg, T, Arch, Obs, Tls, Binder>
where T: SupportLazy, Arch: RelocationArch, Tls: TlsResolver<Arch>, Binder: LazyBinder<Arch>,

Source

pub fn eager(self) -> Self

Forces eager binding.

Source

pub fn lazy(self) -> Self

Forces lazy binding.

Source§

impl<'cfg, T, Arch, Obs, Tls, Binder> RelocatorRun<'cfg, T, Arch, Obs, Tls, Binder>
where Arch: RelocationArch, Tls: TlsResolver<Arch>, Obs: RelocationObserver<Arch>, Binder: LazyBinder<Arch>,

Source

pub fn relocate<D>(self) -> Result<<T as Relocatable<D>>::Output>
where D: Send + Sync + 'static, T: Relocatable<D, Arch = Arch, Tls = Tls>,

Executes relocation with the current run state.

Trait Implementations§

Source§

impl<'cfg, T, Arch, Obs, Tls, Binder> Clone for RelocatorRun<'cfg, T, Arch, Obs, Tls, Binder>
where Arch: RelocationArch, Tls: TlsResolver<Arch>, T: Clone, Obs: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<'cfg, T, Arch = X86_64Arch, Obs = (), Tls = (), Binder = ()> !RefUnwindSafe for RelocatorRun<'cfg, T, Arch, Obs, Tls, Binder>

§

impl<'cfg, T, Arch = X86_64Arch, Obs = (), Tls = (), Binder = ()> !UnwindSafe for RelocatorRun<'cfg, T, Arch, Obs, Tls, Binder>

§

impl<'cfg, T, Arch, Obs, Tls, Binder> Freeze for RelocatorRun<'cfg, T, Arch, Obs, Tls, Binder>
where T: Freeze, LocalScope<Arch, Tls>: Freeze, Option<GlobalScope<Arch, Tls>>: Freeze, Obs: Freeze, Option<Arc<SymbolRegistry<Arch, Tls>>>: Freeze, &'cfg Relocator<Binder>: Freeze,

§

impl<'cfg, T, Arch, Obs, Tls, Binder> Send for RelocatorRun<'cfg, T, Arch, Obs, Tls, Binder>
where T: Send, LocalScope<Arch, Tls>: Send, Option<GlobalScope<Arch, Tls>>: Send, Obs: Send, Option<Arc<SymbolRegistry<Arch, Tls>>>: Send, &'cfg Relocator<Binder>: Send,

§

impl<'cfg, T, Arch, Obs, Tls, Binder> Sync for RelocatorRun<'cfg, T, Arch, Obs, Tls, Binder>
where T: Sync, LocalScope<Arch, Tls>: Sync, Option<GlobalScope<Arch, Tls>>: Sync, Obs: Sync, Option<Arc<SymbolRegistry<Arch, Tls>>>: Sync, &'cfg Relocator<Binder>: Sync,

§

impl<'cfg, T, Arch, Obs, Tls, Binder> Unpin for RelocatorRun<'cfg, T, Arch, Obs, Tls, Binder>
where T: Unpin, LocalScope<Arch, Tls>: Unpin, Option<GlobalScope<Arch, Tls>>: Unpin, Obs: Unpin, Option<Arc<SymbolRegistry<Arch, Tls>>>: Unpin, &'cfg Relocator<Binder>: Unpin,

§

impl<'cfg, T, Arch, Obs, Tls, Binder> UnsafeUnpin for RelocatorRun<'cfg, T, Arch, Obs, Tls, Binder>
where T: UnsafeUnpin, LocalScope<Arch, Tls>: UnsafeUnpin, Option<GlobalScope<Arch, Tls>>: UnsafeUnpin, Obs: UnsafeUnpin, Option<Arc<SymbolRegistry<Arch, Tls>>>: UnsafeUnpin, &'cfg Relocator<Binder>: 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.