Given the following C, fed into Clang, LLC and then WASM-LD to generate a WASM binary:
__attribute__((visibility("default"))) const int an_export_name = 1234;
WASM equivalent to the following WAT is generated:
(module
(memory $memory (export "memory") 2)
(global $an_export_name (export "an_export_name") i32 (i32.const 1024))
(data (i32.const 1024) "\d2\04"))
This appears to have exported:
- A blob of binary data containing the value 1234.
- An i32 constant which is an offset within the binary blob to that value (1024).
Is it possible to instead just export the value? For example:
(module
(memory $memory (export "memory") 2)
(global $an_export_name (export "an_export_name") i32 (i32.const 1234)))