[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


================
@@ -972,6 +1030,15 @@ computeMemberData(raw_ostream &StringTable, raw_ostream &SymNames,
       if (CurSymFile)
         HasObject = true;
     }
+    // On z/OS, when there are no symbols, add a dummy blank symbol
+    // into the symbol table. This is done since the z/OS binder:
+    //   - emits an error if there is no symbol table in the archive
+    //   - emits an error if the symbol table has 0 symbols
+    //   - should not find any references to a blank symbol
+    if ((LastZosObjIndex == Index) && (SymNames.tell() == 0)) {
+      Symbols.push_back(0);
+      SymNames << ' ' << '\0';
----------------
jh7370 wrote:

Is the space actually necessary?

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


More information about the llvm-commits mailing list