Use the wasm relocations custom section if available
Opened this issue · 1 comments
fitzgen commented
It will actually tell us which functions are using which data. The parity_wasm
crate also parses the relocations section, so it shouldn't be too hard to add support for.
If we did this, and our results are noticably better when we have relocations, then we should also document how to build rust to wasm and preserve relocations.
kjvalencik commented
👋 This is a problem I frequently have. Relocations can cause nonsensical results in twiggy paths
for data
ownership. My workaround has been to decompile to wat
and inspect the data section manually, but this is time consuming.
I'm interested in working on this feature. Can you point me in the right direction for building Rust to WASM with a relocations section?