[llvm] [Archive][COFF] Split hybrid COFF files when adding them to an archive (PR #205160)
Martin Storsjö via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 27 15:16:44 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())) {
+ // Strip the hybrid section.
+ D.HybridBuf = COFFObj->stripHybridSection();
+
+ // Create a separate archive member for the hybrid ARM64X object.
+ MemberData &HybridData = Ret.emplace_back();
----------------
mstorsjo wrote:
Here again, this extracted object isn't really so much hybrid, as it's the standalone other single-architecture object file - can we have a better name for it (both in the comment and for the variable)?
https://github.com/llvm/llvm-project/pull/205160
More information about the llvm-commits
mailing list