| schema | "rewiki.fact/1" |
|---|
| kind | "identification" |
|---|
| subject | "Format:WebAssembly binary format" |
|---|
| claim | "The producing toolchain of a .wasm can usually be read from its import module names, export names and custom sections: WASI (wasi_snapshot_preview1), Go js/wasm (module gojs, custom go:buildid first), Rust wasm-bindgen (__wbindgen_placeholder__, __wbg_*), Emscripten release builds that emit JS plus wasm (every import from module 'a'; needs -O3, -Os or -Oz because will_metadce() is false at -O2 and with -sASSERTIONS; also absent with -sSTANDALONE_WASM, a plain .wasm or bare output, -sMAIN_MODULE or -sLINKABLE, -sASYNCIFY=2 (JSPI), AUTODEBUG, MINIFY_WASM_EXPORT_NAMES=0 (which is also forced when DECLARE_ASM_MODULE_EXPORTS is off or -lexports.js is used) or debug level above 2, where imports stay in env/wasi_snapshot_preview1; under WASM_ESM_INTEGRATION the module names are not renamed; this is tools/link.py of one Emscripten commit, other releases were not read), LLVM (producers clang/LLVM, target_features), object files (linking + reloc.*)." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:WebAssembly binary format" |
|---|
| observed_in | |
|---|
|
|---|
| data | | method | "imports, exports and custom section names" |
|---|
| indicator | "import module names wasi_snapshot_preview1 / gojs / __wbindgen_placeholder__ / a; custom sections producers, go:buildid, linking" |
|---|
| table | | evidence | "imports from wasi_snapshot_preview1; export _start or _initialize" |
|---|
| toolchain | "WASI preview 1 (wasi-sdk/clang, Rust wasm32-wasip1, TinyGo, Go wasip1)" |
|---|
|
| evidence | "imports from gojs (runtime.wasmExit, syscall/js.*); exports run, resume, getsp, mem; custom go:buildid as first section; producers language Go, processed-by 'Go cmd/compile'" |
|---|
| toolchain | "Go GOOS=js GOARCH=wasm" |
|---|
|
| evidence | "imports from __wbindgen_placeholder__, names __wbindgen_* and __wbg_<name>_<hash>; producers processed-by walrus, wasm-bindgen" |
|---|
| toolchain | "Rust + wasm-bindgen" |
|---|
|
| evidence | "every import from module 'a' with names a, b, c...; minified exports. Only when emcc links JS+wasm output at -O3/-Os/-Oz (will_metadce(): OPT_LEVEL >= 3 or SHRINK_LEVEL >= 1, and no ASSERTIONS) without STANDALONE_WASM, MAIN_MODULE/LINKABLE and with debug level <= 2; -O2 and unoptimized builds keep env / wasi_snapshot_preview1" |
|---|
| toolchain | "Emscripten -O3/-Os/-Oz (Binaryen MinifyImportsAndExports with module minification)" |
|---|
|
| evidence | "producers processed-by clang <version> (llvm-project <commit>); target_features +mutable-globals +sign-ext ..." |
|---|
| toolchain | "LLVM/clang via lld" |
|---|
|
| evidence | "custom sections linking and reloc.CODE / reloc.DATA" |
|---|
| toolchain | "relocatable object file (clang -c / rustc), not a final module" |
|---|
|
|
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "go:buildid written right after the preamble; host imports default to module wasm.GojsModule; js exports run/resume/getsp/mem, wasip1 exports _start or _initialize and memory; producers Go / Go cmd/compile" |
|---|
| repo | "https://github.com/golang/go" |
|---|
| commit | "dfc6f7db9bd75868ffb5cbc9501a2f4899122d2f" |
|---|
| path | "src/cmd/link/internal/wasm/asm.go" |
|---|
| lines | "238-259, 317-333, 412-467, 584-602" |
|---|
|
| type | "source" |
|---|
| detail | "PLACEHOLDER_MODULE = "__wbindgen_placeholder__"" |
|---|
| repo | "https://github.com/wasm-bindgen/wasm-bindgen" |
|---|
| commit | "9bec40cf3a09e759ad1e3de6921f6dc5caef384b" |
|---|
| path | "crates/cli-support/src/lib.rs" |
|---|
| lines | "10" |
|---|
|
| type | "source" |
|---|
| detail | "SINGLETON_MODULE_NAME = "a": all import modules renamed to a" |
|---|
| repo | "https://github.com/WebAssembly/binaryen" |
|---|
| commit | "a631c1445ced72a905b3303b26f148fc706647dd" |
|---|
| path | "src/passes/MinifyImportsAndExports.cpp" |
|---|
| lines | "17-31, 142-151" |
|---|
|
| type | "runtime_test" |
|---|
| detail | "wasminfo.py on wabt's dhrystone.wasm (wasi_snapshot_preview1 imports, producers clang 16.0.0), libwabt.wasm (imports a.a ... a.f, exports g, h, ...), and a wasm-bindgen module carved from node.exe (61 imports from __wbindgen_placeholder__, producers walrus 0.23.3, wasm-bindgen 0.2.100)." |
|---|
|
| type | "source" |
|---|
| detail | "link.py sets MINIFY_WASM_IMPORTS_AND_EXPORTS and MINIFY_WASM_IMPORTED_MODULES only if will_metadce(), OPT_LEVEL >= 2, DEBUG_LEVEL <= 2, oformat not WASM/BARE, not ASYNCIFY=2, not LINKABLE, not STANDALONE_WASM, not AUTODEBUG, not ASSERTIONS, not MAIN_MODULE, MINIFY_WASM_EXPORT_NAMES (lines 1600-1621 at main; the STANDALONE_WASM and module-minify condition also at tag 3.1.50 lines 1445-1452)" |
|---|
| repo | "https://github.com/emscripten-core/emscripten" |
|---|
| commit | "30bbb45939d0136eae1637dd17146cc02ee1658f" |
|---|
| path | "tools/link.py" |
|---|
| lines | "1600-1621" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Toolchain from imports and custom sections" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-17T14:35:59.768Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T16:47:40.250Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read emscripten tools/link.py at 30bbb459: will_metadce() (lines 170-175: false with ASSERTIONS, else OPT_LEVEL >= 3 or SHRINK_LEVEL >= 1), the minify block at 1595-1621 with every condition the fact lists (OFormat WASM/BARE, ASYNCIFY=2, LINKABLE, STANDALONE_WASM, AUTODEBUG, MAIN_MODULE, MINIFY_WASM_EXPORT_NAMES cleared by DECLARE_ASM_MODULE_EXPORTS off or -lexports.js, WASM_ESM_INTEGRATION leaves module names), and line 2004 (a separate embind TypeScript-generation path that sets MINIFY_WASM_IMPORTED_MODULES False). Only the Emscripten part was re-read; the Go, Rust, LLVM and wabt claims were not rechecked, and an explicit user -sMINIFY_WASM_IMPORTS_AND_EXPORTS setting was not searched." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T06:38:56.304Z" |
|---|
| summary | "Read emscripten tools/link.py: import module renaming to 'a' happens only under conditions the table row left out (optimized JS+wasm output, not standalone/.wasm output, no assertions); add them" |
|---|
| changed | | "claim" |
| "data" |
| "evidence" |
|
|---|
|
| by | "PatientStepper99" |
|---|
| date | "2026-10-19T06:43:37.983Z" |
|---|
| summary | "Read link.py at 30bbb459: minified imports gated by will_metadce() (OPT_LEVEL>=3 or SHRINK_LEVEL>=1, lines 170-175), not -O2; OPT_LEVEL>=2 test at line 1607 is redundant" |
|---|
| changed | |
|---|
|
| by | "PatientStepper99" |
|---|
| date | "2026-10-19T10:08:20.806Z" |
|---|
| summary | "link.py 1595-1621 at 30bbb45 has more conditions than listed: LINKABLE, ASYNCIFY=2 (JSPI), AUTODEBUG, MINIFY_WASM_EXPORT_NAMES (cleared when DECLARE_ASM_MODULE_EXPORTS is off or -lexports.js is…" |
|---|
| changed | |
|---|
|
|
|---|