[llvm] [SystemZ][z/OS] Add z/OS archive writing support (PR #200087)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 4 01:05:22 PDT 2026


================
@@ -631,14 +670,25 @@ static void writeSymbolTable(raw_ostream &Out, object::Archive::Kind Kind,
       if (isBSDLike(Kind))
         printNBits(Out, Kind, StringOffset);
       printNBits(Out, Kind, Pos); // member offset
+      if (isZOSArchive(Kind))
+        printNBits(Out, Kind, Pos); // symbol flags
     }
     Pos += M.Header.size() + M.Data.size() + M.Padding.size();
   }
 
   if (isBSDLike(Kind))
     // byte count of the string table
     printNBits(Out, Kind, StringTable.size());
-  Out << StringTable;
+  if (isZOSArchive(Kind)) {
+    std::string AStringTable;
+    raw_string_ostream AOut(AStringTable);
+    AOut << StringTable;
----------------
jh7370 wrote:

This seems unnecessary? Can't you just pass `StringTable` directly to `convertToEBCDIC`?

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


More information about the llvm-commits mailing list