[llvm] [WebAssembly] Implement lowering calls through funcref to call_ref when available (PR #162227)
Demetrius Kanios via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 15 00:30:05 PDT 2025
QuantumSegfault wrote:
Alright, so after poking around at it some more, I think it ultimately comes down to the fact that the `__funcref_call_table` is never defined anywhere.
The symbol is marked "isWeak" as if the table was designed to be fully defined in EACH object file, with the linker just choosing one (all of them are the same, with a single default-initialized `ref.null` element, so it shouldn't matter). However this never happens, so it hits `WasmObjectWriter` undefined, triggering the assert. Meanwhile, the linker also makes no attempt to define the table.
So we either need a way to define/initialize the table per-object (which I'm struggling to find; just a simple way to mark it "defined"...which seems to require a `MCFragment` to give to `MCSymbol::setFragment`???). Either that, or we drop "isWeak" and just define it at link time. Suggestions?
https://github.com/llvm/llvm-project/pull/162227
More information about the llvm-commits
mailing list