Apologies if there is a better forum for these questions. Please redirect me if so.
I’ve been using the clang/wasm-ld tools to experiment with some basic examples, and there’s a couple things I’m wrestling with.
How to denote a function as the “start” function (https://webassembly.github.io/spec/core/binary/modules.html#start-section)
How to avoid the defaulted __heap_base global.
I’ve dug around on the samples, mailing lists, and in the wasm-ld code for an attribute or flag to specify the start function, but don’t see anything. Is this just not implemented (or tracked) yet?
For 2), I always see the below global in the compiled output even with the most trivial code that makes no reference to it (e.g. compiling just a simple function that only references values on the implicit operand stack).
(global (;0;) (mut i32) (i32.const 66560))
Per https://dassur.ma/things/c-to-webassembly/, looks like this is the __heap_base value implicitly provided for modeling the stack/heap as are usually present in most C/C++ environments, even though unused in my compiled output. Is this something that could/should be optimized away, but again just isn’t implemented yet? Any way to suppress this building with the current clang/wasm-ld toolchain?