[lld] [lld][WebAssembly] Fix relocation of Wasm table index with GOT access (PR #104043)

Luc Blaeser via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 02:29:04 PDT 2024


================
@@ -0,0 +1,27 @@
+# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t.o %s
----------------
luc-blaeser wrote:

Thank you. I agree. The error message would also apply to `R_WASM_MEMORY_ADDR_REL_` relocation types.

I have seen that bad pic relocations are reported as errors unless `UnresolvedPolicy::ImportDynamic` is enabled. Perhaps undefined PIC relocations in code should always be reported as errors, since they cannot be later resolved by subsequent dynamic Wasm linking (unlike GOT globals) if I understand correctly. Probably, this is more a design question, and certainly better addressed separately of this PR.

BTW: I noticed the link error when building the runtime system for our PL called Motoko with latest Rust (nigthly 2024-07-28) and `wasm64`.

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


More information about the llvm-commits mailing list