[lld] [lld][WebAssembly] Report Unsupported PIC Relocations as Errors (PR #104926)

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 17 06:45:16 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
----------------
sbc100 wrote:

I'm still curious how you were able to generate such relocations?  IIUC, LLVM will not generate these relocations for undefined symbols.  Did you come across this issue by writing asm code?  Or is there some issue where LLVM can generate these wrongly?

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


More information about the llvm-commits mailing list