Skip to content

Fix functions reachable through static mut#42

Merged
WorldSEnder merged 5 commits into
mainfrom
static-mut-fix
Jun 23, 2026
Merged

Fix functions reachable through static mut#42
WorldSEnder merged 5 commits into
mainfrom
static-mut-fix

Conversation

@WorldSEnder

@WorldSEnder WorldSEnder commented Jun 23, 2026

Copy link
Copy Markdown
Owner

Exported data symbols are exposed as globals containing the address of that data symbol. There are currently no relocations emitted for the global initializers. Hence, the dependency graph didn't detect that these symbols would be reachable and that their initializer expression had to be relocated.

Fixes #38 here such an exposed data symbol is introduced in wasm-bindgen (__abort_handler and __instance_terminated).

See also WebAssembly/tool-conventions#153 for example
Global initializers refering to data symbols, i.e. their address,
do not get relocations targeting them.
We reconstruct these missing relocations and insert dependencies
for them by matching on the global name/symbol name.
@WorldSEnder WorldSEnder merged commit da2ef34 into main Jun 23, 2026
5 checks passed
@WorldSEnder WorldSEnder deleted the static-mut-fix branch June 23, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

wasm_split_cli crashes on wasm-bindgen >=0.2.125: "No indirect function table index for input function N"

1 participant