Skip to content

emstrip strips out the dylink.0 section #26563

@ryanking13

Description

@ryanking13

I am not sure if this is an intentional behavior or not, but reporting for visibility.

I noticed that emstrip recently started to strip out the dylink.0 section from the WASM binary, breaking modules built with -sSIDE_MODULE flag set.

This started to happen since Emscripten 5.0.1, and wasn't the case before 5.0.0

Version of emscripten/emsdk:

emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 5.0.3 (285c424dfa9e83b03cf8490c65ceadb7c45f28eb)
clang version 23.0.0git (https:/github.com/llvm/llvm-project e5927fecf8a6ce89e1a4eac5b828e7d42676452a)

Failing command line in full:

// lib.c
int add(int a, int b) { return a + b; }
emcc -o "lib.wasm" -shared -sSIDE_MODULE=1 lib.c

echo "before:"; llvm-objdump -h "lib.wasm" | grep -i dylink || echo "dylink.0 missing"

cp "lib.wasm" "lib.stripped.wasm"
emstrip "lib.stripped.wasm"

echo "after:"; llvm-objdump -h "lib.stripped.wasm" | grep -i dylink || echo "dylink.0 missing"

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions