pub struct Loader { /* private fields */ }Expand description
The Loader is a helper struct that creates a Compiler by
- Loading an ELF file
- collecting its shared dependencies
- lifting all RISC-V code into an IR
- making code and data available in a
ProcessImage
Implementations§
Source§impl Loader
impl Loader
Sourcepub fn binary<P: Into<PathBuf>>(self, binary: P) -> Self
pub fn binary<P: Into<PathBuf>>(self, binary: P) -> Self
Set the target binary that is going to be emulated
Sourcepub fn search_path<P: Into<PathBuf>>(self, search_path: P) -> Self
pub fn search_path<P: Into<PathBuf>>(self, search_path: P) -> Self
Add the given directory to the search paths of the ELF loader. The shared dependencies of the binary will be searched here (similar to LD_LIBRARY_PATH). You can specify this option multiple times.
Sourcepub fn search_paths<I, P>(self, search_paths: I) -> Self
pub fn search_paths<I, P>(self, search_paths: I) -> Self
Add multiple directories to the search paths of the ELF loader.
Does the same as Loader::search_path.
Sourcepub fn preload<P: Into<PathBuf>>(self, library: P) -> Self
pub fn preload<P: Into<PathBuf>>(self, library: P) -> Self
Preload this library (similar to LD_PRELOAD). You can specify this option multiple times.
Sourcepub fn preloads<I, P>(self, preloads: I) -> Self
pub fn preloads<I, P>(self, preloads: I) -> Self
Preload multiple libraries.
Does the same as Loader::preload.
Sourcepub fn ignore_missing_dependencies(self, flag: bool) -> Self
pub fn ignore_missing_dependencies(self, flag: bool) -> Self
If flag is set to true, the ELF loader will not throw an error when it cannot
find a dependency in the provided search paths.
Auto Trait Implementations§
impl Freeze for Loader
impl RefUnwindSafe for Loader
impl Send for Loader
impl Sync for Loader
impl Unpin for Loader
impl UnwindSafe for Loader
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