add a way to provide imported functions during relocation
They are provided as a closure taking the module (&str) and function name (&str) as arguments, returning an address (Option<isize>)
This commit is contained in:
committed by
Dan Gohman
parent
d72ebe53d4
commit
7fca0792dd
@@ -145,8 +145,12 @@ fn handle_module(args: &Args, path: PathBuf, isa: &TargetIsa) -> Result<(), Stri
|
||||
}
|
||||
let mut module = Module::new();
|
||||
let environ = ModuleEnvironment::new(isa, &mut module);
|
||||
|
||||
let imports_resolver = |_env: &str, _function: &str| None;
|
||||
|
||||
let translation = environ.translate(&data).map_err(|e| e.to_string())?;
|
||||
let instance = match compile_and_link_module(isa, &translation) {
|
||||
|
||||
let instance = match compile_and_link_module(isa, &translation, &imports_resolver) {
|
||||
Ok(compilation) => {
|
||||
let mut instance = Instance::new(
|
||||
translation.module,
|
||||
|
||||
Reference in New Issue
Block a user