Handle select relocations while generating trampolines (#1347)
* Handle select relocations while generating trampolines Trampoline generation for all function signatures exposed a preexisting bug in wasmtime where trampoline generation occasionally does have relocations, but it's asserted that trampolines don't generate relocations, causing a panic. The relocation is currently primarily the probestack function which happens when functions might have a huge number of parameters, but not so huge as to blow the wasmparser limit of how many parameters are allowed. This commit fixes the issue by handling relocations for trampolines in the same manner as the rest of the code. Note that dynamically-generated trampolines via the `Func` API still panic if they have too many arguments and generate a relocation, but it seems like we can try to fix that later if the need truly arises. Closes #1322 * Log trampoline relocations
This commit is contained in:
@@ -289,13 +289,14 @@ pub fn create_handle_with_function(
|
||||
// ... and then we also need a trampoline with the standard "trampoline ABI"
|
||||
// which enters into the ABI specified by `ft`. Note that this is only used
|
||||
// if `Func::call` is called on an object created by `Func::new`.
|
||||
let trampoline = wasmtime_jit::make_trampoline(
|
||||
let (trampoline, relocations) = wasmtime_jit::make_trampoline(
|
||||
&*isa,
|
||||
&mut code_memory,
|
||||
&mut fn_builder_ctx,
|
||||
&sig,
|
||||
mem::size_of::<u128>(),
|
||||
)?;
|
||||
assert!(relocations.is_empty());
|
||||
let sig_id = store.compiler().signatures().register(&sig);
|
||||
trampolines.insert(sig_id, trampoline);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user