[llvm] [Archive][COFF] Split hybrid COFF files when adding them to an archive (PR #205160)

Jacek Caban via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 30 05:28:43 PDT 2026


================
@@ -855,6 +857,33 @@ computeMemberData(raw_ostream &StringTable, raw_ostream &SymNames,
       if (!SymFileOrErr)
         return createFileError(M.MemberName, SymFileOrErr.takeError());
       D.SymFile = std::move(*SymFileOrErr);
+
+      if (SymMap && D.SymFile.get()) {
+        auto COFFObj = dyn_cast<COFFObjectFile>(D.SymFile.get());
+        std::optional<MemoryBufferRef> HybridView;
+        if (COFFObj && (HybridView = COFFObj->findHybridObjectSection())) {
----------------
cjacek wrote:

I do not see a case where it would be useful. Disabling it would cause only the native object to be present in the symbol table, so the EC object would not be visible. If that is the intention, one could use objcopy to remove the section before adding the object to the archive.

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


More information about the llvm-commits mailing list