[llvm] [WebAssembly] Support multiple `.init_array` fragments when writing Wasm objects (PR #111008)

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 15:50:16 PST 2024


================
@@ -1769,6 +1769,11 @@ uint64_t WasmObjectWriter::writeOneObject(MCAssembler &Asm,
       WS.setIndex(InvalidIndex);
       continue;
     }
+    // Contents of .init_array sections are handled elsewhere.
+    if (WS.isDefined() &&
+        WS.getSection().getName().starts_with(".init_array")) {
----------------
sbc100 wrote:

Should we error out int this maybe?   It seems like if somebody had a usage of `p_init` somewhere it would simply not work.  How about something like  "symbols within `.init_array` sections are not supported"?

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


More information about the llvm-commits mailing list