[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


================
@@ -390,8 +418,11 @@ static uint64_t computeSymbolTableSize(object::Archive::Kind Kind,
   uint64_t Size = OffsetSize; // Number of entries
   if (isBSDLike(Kind))
     Size += NumSyms * OffsetSize * 2; // Table
+  else if (isZOSArchive(Kind))
+    Size += NumSyms * OffsetSize * 2; // MemberOffset + symbol flags
----------------
jh7370 wrote:

I've been scratching my head as to what is different between this and the BSD case and if I'm following it correctly, it's just because the entries are the same size, but have different meanings? I found the comment difference confusing rather than helpful, especially as the comment describes an individual entry in the table, rather than what the full calculation represents.

Long story short, I think you should fold the z/OS and BSD cases together and if you feel like it's worth describing what an entry consists of, do it for all formats. Something like:
```
// For all archive formats, each entry consists of ...
// For BSD, each entry also includes a ...
// For z/OS, each entry also includes a flag field.
if (isBSDLike(Kind) || isZOSArchive(Kind))
```

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


More information about the llvm-commits mailing list