[lld] [lld][WebAssembly] Don't export deps for unused stub symbols (PR #173422)

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 23 15:51:31 PST 2025


================
@@ -16,6 +16,23 @@
 # RUN: wasm-ld %t.o %t/libfoo.a %p/Inputs/stub.so -o %t2.wasm
 # RUN: obj2yaml %t2.wasm | FileCheck %s
 
+## The function `foo` is declared in stub2.so and depends on `baz`, and both
+## `foo` and `baz` are defined in an LTO object. When `foo` and `baz` are
+## DCE'd and become undefined in the LTO process, wasm-ld should not try to
+## export the (nonexistent) `baz`.
+
+# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
+# RUN: mkdir -p %t
+# RUN: llvm-as %S/Inputs/foo.ll -o %t/foo.o
----------------
sbc100 wrote:

Should this bee foobaz.ll here and above?

https://github.com/llvm/llvm-project/pull/173422


More information about the llvm-commits mailing list