pub struct SyntheticModule<Arch: RelocationArch = NativeArch, D = (), R = ()> { /* private fields */ }Expand description
A Module backed by a synthetic table of absolute symbols.
The module owns stable synthetic ELF symbols, so it can be retained in a
ModuleScope without borrowing callback-owned
symbol metadata.
Implementations§
Source§impl<Arch: RelocationArch> SyntheticModule<Arch>
impl<Arch: RelocationArch> SyntheticModule<Arch>
Sourcepub fn new<I>(name: impl Into<String>, symbols: I) -> Selfwhere
I: IntoIterator<Item = SyntheticSymbol>,
pub fn new<I>(name: impl Into<String>, symbols: I) -> Selfwhere
I: IntoIterator<Item = SyntheticSymbol>,
Creates a module from an ordered list of synthetic symbols.
Source§impl<Arch: RelocationArch, D, R> SyntheticModule<Arch, D, R>
impl<Arch: RelocationArch, D, R> SyntheticModule<Arch, D, R>
Sourcepub fn with_user_data<NewD>(
self,
user_data: NewD,
) -> SyntheticModule<Arch, NewD, R>
pub fn with_user_data<NewD>( self, user_data: NewD, ) -> SyntheticModule<Arch, NewD, R>
Replaces the user data associated with this synthetic module.
Sourcepub fn user_data_mut(&mut self) -> &mut D
pub fn user_data_mut(&mut self) -> &mut D
Returns mutable user data for this synthetic module.
Sourcepub fn with_memory<M>(self, memory: M) -> Selfwhere
M: ImageMemory + 'static,
pub fn with_memory<M>(self, memory: M) -> Selfwhere
M: ImageMemory + 'static,
Uses a real image-memory backend for this synthetic module.
This is required when synthetic symbols may be used as byte sources, such as for COPY relocations against synthetic object symbols.
Sourcepub fn with_tls(self, tls: ModuleTls) -> Self
pub fn with_tls(self, tls: ModuleTls) -> Self
Sets TLS metadata exposed by this synthetic module.
Sourcepub fn with_resolve_hook<F>(self, hook: F) -> SyntheticModule<Arch, D, F>
pub fn with_resolve_hook<F>(self, hook: F) -> SyntheticModule<Arch, D, F>
Runs a callback when a synthetic symbol is resolved.
The callback receives the symbol’s stable address and may prepare lazy runtime state before that address is returned.
Sourcepub fn with_domain(self, domain: DomainId) -> Self
pub fn with_domain(self, domain: DomainId) -> Self
Binds this synthetic module to one runtime domain.
Sourcepub fn insert(&mut self, symbol: SyntheticSymbol) -> Option<SyntheticSymbol>
pub fn insert(&mut self, symbol: SyntheticSymbol) -> Option<SyntheticSymbol>
Inserts one symbol, returning the definition it replaced.