I am updating data in data section when wasmtime is parsing and validating wasm module using wasmparser. But this updating changes the length of the data and so I need to update all offsets in the functions. Is there a way to do it in wasmtime or not?
I could be mistaken, but that doesn't sound plausible generally.
(deleted)
Can I do that in compiler-level in Rustc to change the allocated length?
Presumably :shrug:
You need to do it before linking. After linking the relocation information necessary for this is lost.
@bjorn3 can you please explain it more? How can I do it before linking?
You can pass -Csave-temps
to rustc to save all temporary unlinked object files. You can then edit those using the information in the linking section and then run the linker command that rustc would normally use to produce the final executable wasm module.
Last updated: Dec 23 2024 at 13:07 UTC