[llvm] [WebAssembly] Handle symbols in `.init_array` sections (PR #119127)

Sam Clegg via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 8 17:43:12 PST 2024


================
@@ -1482,10 +1482,6 @@ uint64_t WasmObjectWriter::writeOneObject(MCAssembler &Asm,
     LLVM_DEBUG(dbgs() << "Processing Section " << SectionName << "  group "
                       << Section.getGroup() << "\n";);
 
-    // .init_array sections are handled specially elsewhere.
-    if (SectionName.starts_with(".init_array"))
-      continue;
----------------
sbc100 wrote:

Can would write this data if (and only if) there are symbols that point to it?   Wasm is very sensitive to binary size and even a few bytes of wasted data section is not desirable, especially since unused data is impossible to DCE after linking.

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


More information about the llvm-commits mailing list