emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.91k stars 3.32k forks source link

Fix data address exports under `-sMAIN_MODULE=1` #23020

Closed sbc100 closed 1 week ago

sbc100 commented 1 week ago

In -sMAIN_MODULE=1 mode we actually link twice, once to get the names the user exported symbols then again with everything exported.

We when use the this base_metadata to limit the things that we export to on the JS module. However for data symbols we cannot use the addresses/values present in base_metadata.

Fixes: #22980