Place unwind info directly after the text section, even when debug info is enabled
When debug info was enabled, we would put the debug info sections in between the text section and the unwind info section. But the unwind info is encoded in a position-independent manner (so that we don't need relocs for it) that relies on it directly following the text section. The result of the misplacement was some crashes inside the unwinder.
This commit is contained in:
@@ -271,6 +271,8 @@ impl wasmtime_environ::Compiler for Compiler {
|
||||
trampolines.push(builder.trampoline(*i, &func));
|
||||
}
|
||||
|
||||
builder.unwind_info();
|
||||
|
||||
if emit_dwarf && funcs.len() > 0 {
|
||||
let ofs = VMOffsets::new(
|
||||
self.isa
|
||||
@@ -330,6 +332,7 @@ impl wasmtime_environ::Compiler for Compiler {
|
||||
let mut builder = ObjectBuilder::new(obj, &module, &*self.isa);
|
||||
let a = builder.trampoline(SignatureIndex::new(0), &host_to_wasm);
|
||||
let b = builder.trampoline(SignatureIndex::new(1), &wasm_to_host);
|
||||
builder.unwind_info();
|
||||
builder.finish()?;
|
||||
Ok((a, b))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user