[llvm] [SystemZ][z/OS] Add z/OS archive writing support (PR #200087)
Amy Kwan via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 11 21:55:32 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';
----------------
amy-kwan wrote:
To my understanding, it is necessary as it resolves a binder crash that can possibly happen when we have a 0-length symbol in archive. I believe dding a single character blank suppresses the binder error, not sure if @redstar is able to confirm or shed any insight to this?
https://github.com/llvm/llvm-project/pull/200087
More information about the llvm-commits
mailing list