[llvm] [llvm-nm][GOFF] Display archive attributes in GOFF archives through --print-armap (PR #214527)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 01:37:12 PDT 2026


================
@@ -2045,9 +2045,40 @@ static bool checkMachOAndArchFlags(SymbolicFile *O, StringRef Filename) {
   return true;
 }
 
-static void printArchiveMap(iterator_range<Archive::symbol_iterator> &map,
-                            StringRef Filename) {
-  for (auto I : map) {
+/// Decode the low 3 bits of a z/OS archive symbol attribute word into a
+/// human-readable string, e.g. "[64-bit + XPLink]".
+/// Any bits above the known 3-bit mask produce a trailing "?" flag.
+static std::string decodeZOSAttributes(uint32_t Attrs) {
+  bool Unknown = (Attrs & ~Archive::Symbol::ZOSKnownAttrMask) != 0;
+  bool Is64Bit = (Attrs & Archive::Symbol::ZOSAttr64Bit) != 0;
+  bool IsXPLink = (Attrs & Archive::Symbol::ZOSAttrXPLink) != 0;
+  bool IsWSA = (Attrs & Archive::Symbol::ZOSAttrWSA) != 0;
+
+  std::string Result = "[";
+  bool NeedPlus = false;
+  auto append = [&](const char *S) {
----------------
jh7370 wrote:

Nit: consensus in the LLVM project is that lambdas should use variable naming styles, i.e. `Append`, not `append`.

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


More information about the llvm-commits mailing list