Hello,
I want to produce a wasm binary with exported symbol of some size. That symbol is not used in Rust code at all. Code that manages interpreter imports that export and calls functions from wasm with references to that symbol. Right now it is sized type and everything works fine. I also don't want to have externref, because that object is big and I have a lot of unused space inside wasm page (which is 64KiB) and I want to use it to store that object instead of other RAM - I'm working in embedded environment.
Right now I need to make that exported symbol a DST, I would know it's size before linking but after compiling Rust. In my head it should work like that:
Rust code compiles to work with fat references once.
Then I'm somehow changing wasm binary with different sized of that symbol, producing different binaries.
I know about tool wasm-merge, which can connect imports and exports in two wasm blobs, but I did not manage to get rust to generate a good import.
Do you have any idea how can it be done? Which tools could be used?
Thank you.