Change load_object_file to take a RelocationTarget instead of a LocalFunctionIndex.

This removes its last connection to the implementation details of having a wasm_module, which we don't want to have to rely on when building trampolines.

There currently isn't a RelocationTarget for a trampoline function that refers to itself (none of been observed to done so yet), so we make the RelocationTarget optional.
This commit is contained in:
Nick Lewycky
2020-05-21 13:40:08 -07:00
parent 02f7e58c01
commit 3764e7b9f8
2 changed files with 7 additions and 8 deletions

View File

@ -279,7 +279,7 @@ impl FuncTranslator {
load_object_file(
mem_buf_slice,
".wasmer_function",
*local_func_index,
Some(RelocationTarget::LocalFunc(*local_func_index)),
|name: &String| {
if let Some((index, _)) = func_names
.iter()