emscripten-core / emscripten-core/emscripten

emstrip strips out the `dylink.0` section

Open
#26,563 3 comments 0 reactions 1 assignee Claimed by @dschuff View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

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:**

```c
// 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"
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.