[llvm] [MC][WebAssembly] Fix importing tables with limits (PR #172992)

via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 22 14:27:46 PST 2025


================
@@ -1849,6 +1850,15 @@ uint64_t WasmObjectWriter::writeOneObject(MCAssembler &Asm,
       HandleReloc(RelEntry);
     for (const WasmRelocationEntry &RelEntry : DataRelocations)
       HandleReloc(RelEntry);
+
+    // Update minimum size of `__indirect_function_table` table.
+    auto It = llvm::find_if(Imports, [](const wasm::WasmImport &I) {
+      return I.Field == "__indirect_function_table";
+    });
----------------
daxpedda wrote:

So just to start, I simply attempted to move `prepareImports` after all modifications were done.

However, it seems this requires a larger refactor around `WasmIndices` and how it interacts with all the present systems. I don't really feel comfortable doing that given my entirely rusted C++ skills and lack of familiarity with the LLVM codebase.

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


More information about the llvm-commits mailing list