Hi,

I'm writing a simple wasm compiler for a version of BASIC, and am planning 
to link the output with an emscripten coded 'runtime' wasm module.

I tried to do this once before by adding support for the custom lld 
sections earlier, but it turned into a bit of an ordeal (it was over half 
the code!) so I gave up. The new plan is to link with an emscripten runtime 
at the 'final module' level.This involves loading the emscripten runtime 
wasm module, and than appending my compiler output to this to create a new 
standalone module. The main idea here is that I wont have to mess with the 
emscripten stuff much - I can just add my functions to the end of the 
functions table etc.

The first problem I've encountered though is how to append static/global 
data. My code will need to use memory offsets past the end of whatever the 
emscripten runtime needs (and before dynamic memory which I guess comes 
from the same pool?) and the only way I can think of to do this is to add 
pages to the 'memory' import, but the resolution of that would be 64K which 
isn't bad I guess but seems excessive.

Is there any way to be able to tell from looking at a wasm module what the 
'highest' memory address it uses is? I remember C used to have data_start 
and data_end (or similar) globals and was hoping emscripten might export 
something similar but it doesn't seem to.

Bye!
Mark

-- 
You received this message because you are subscribed to the Google Groups 
"emscripten-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to emscripten-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/emscripten-discuss/4062abb6-e1cb-44b3-887a-333ceb8ed808n%40googlegroups.com.

Reply via email to