[lld] [llvm] [lld][WebAssembly] Report undefined symbols by default -shared/-pie builds (PR #75242)
Sam Clegg via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 3 15:23:42 PDT 2024
================
@@ -0,0 +1,30 @@
+# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-emscripten -o %t.o %s
+# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-emscripten %p/Inputs/ret32.s -o %t.ret32.o
+# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-emscripten %p/Inputs/libsearch-dyn.s -o %t.dyn.o
+# RUN: wasm-ld --experimental-pic -shared %t.ret32.o %t.dyn.o -o %t.lib.so
+# RUN: not wasm-ld --experimental-pic -pie -o %t.wasm %t.o 2>&1 | FileCheck --check-prefix=ERROR %s
+# RUN: wasm-ld --experimental-pic -pie -o %t.wasm %t.o %t.lib.so
+# RUN: obj2yaml %t.wasm | FileCheck %s
+
+# ERROR: error: {{.*}}: undefined symbol: ret32
+.functype ret32 (f32) -> (i32)
+
+.globl _start
+_start:
+ .functype _start () -> ()
+ f32.const 0.0
+ call ret32
+ drop
+ i32.const _dynamic at GOT
----------------
sbc100 wrote:
Update test to cover the undefined data symbol.
https://github.com/llvm/llvm-project/pull/75242
More information about the llvm-commits
mailing list