[lld] [lld][WebAssembly] Report Unsupported PIC Relocations as Errors (PR #104926)
Luc Blaeser via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 17 23:37:15 PDT 2024
================
@@ -0,0 +1,39 @@
+# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
+
+# RUN: not wasm-ld --experimental-pic -shared %t.o -o /dev/null 2>&1 | \
+# RUN: FileCheck %s
+
+# RUN: not wasm-ld --experimental-pic -shared %t.o -o /dev/null --unresolved-symbols=report-all 2>&1 | \
+# RUN: FileCheck %s
+
+# RUN: not wasm-ld --experimental-pic -shared %t.o -o /dev/null --warn-unresolved-symbols 2>&1 | \
+# RUN: FileCheck %s
+
+# RUN: not wasm-ld --experimental-pic -shared %t.o -o /dev/null --unresolved-symbols=ignore-all 2>&1 | \
+# RUN: FileCheck %s
+
+# RUN: not wasm-ld --experimental-pic -shared %t.o -o /dev/null --unresolved-symbols=import-dynamic 2>&1 | \
+# RUN: FileCheck %s
+
+.functype external_func () -> ()
+
+use_undefined_function:
+ .functype use_undefined_function () -> ()
+ i32.const external_func at TBREL
----------------
luc-blaeser wrote:
I was using Rust and emitted LLVM IR that I manually compiled down to a Wasm object file. During testing, I once missed a LLVM IR input file and then saw those relocations on unused functions, without getting an error. It is certainly an edge case.
https://github.com/llvm/llvm-project/pull/104926
More information about the llvm-commits
mailing list