[llvm] [llvm-ar][GOFF] Implement symbol attributes for GOFF archives (PR #214528)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 4 01:05:28 PDT 2026


================
@@ -677,13 +680,14 @@ static void writeSymbolTable(raw_ostream &Out, object::Archive::Kind Kind,
       }
     }
 
-    for (unsigned StringOffset : M.Symbols) {
+    assert((!isZOSArchive(Kind) || M.Symbols.size() == M.SymbolAttrs.size()) &&
+           "Incorrect number of symbol attributes!");
+    for (size_t I = 0, E = M.Symbols.size(); I != E; ++I) {
       if (isBSDLike(Kind))
-        printNBits(Out, Kind, StringOffset);
+        printNBits(Out, Kind, M.Symbols[I]);
       printNBits(Out, Kind, Pos); // member offset
-      // FIXME: Properly handle symbol attributes for z/OS archives.
       if (isZOSArchive(Kind))
-        printNBits(Out, Kind, 0); // symbol flags
+        printNBits(Out, Kind, M.SymbolAttrs[I]); // symbol attribute flags
----------------
jh7370 wrote:

Nit: Let's just call them "symbol attributes", unless the spec refers to them as "attribute flags".

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


More information about the llvm-commits mailing list