Loader

Struct Loader 

Source
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

Source

pub fn binary<P: Into<PathBuf>>(self, binary: P) -> Self

Set the target binary that is going to be emulated

Source

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.

Source

pub fn search_paths<I, P>(self, search_paths: I) -> Self
where I: IntoIterator<Item = P>, P: Into<PathBuf>,

Add multiple directories to the search paths of the ELF loader. Does the same as Loader::search_path.

Source

pub fn preload<P: Into<PathBuf>>(self, library: P) -> Self

Preload this library (similar to LD_PRELOAD). You can specify this option multiple times.

Source

pub fn preloads<I, P>(self, preloads: I) -> Self
where I: IntoIterator<Item = P>, P: Into<PathBuf>,

Preload multiple libraries. Does the same as Loader::preload.

Source

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.

Source

pub fn load(self) -> Result<Compiler, CompilerError<'static>>

Create a Compiler by loading the target binary

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> 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 = Infallible

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.