[llvm] [z/OS] Add z/OS archive reading support (PR #187110)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 13 08:59:39 PDT 2026


================
@@ -1171,6 +1305,15 @@ Archive::symbol_iterator Archive::symbol_begin() const {
     buf += ran_strx;
   } else if (kind() == K_AIXBIG) {
     buf = getStringTable().begin();
+  } else if (kind() == K_ZOS) {
+    // The contents of the z/OS symbol table member are:
+    // 1. The number of symbols, NS (4-byte integer).
+    // 2. NS pairs of 4-byte integers (offset and attributes). Length is NS*8
+    // bytes.
+    // 3. NS null terminated strings of corresponding symbol names.
+    // Here we skip parts 1 and 2 to reach the start of the string table.
+    uint32_t symbol_count = read32be(buf);
----------------
jh7370 wrote:

Is `symbol_count` the exact way the term is written in the relevant source specification? If it isn't, please either a) follow what is in the spec, or b) follow the LLVM naming standard of TitleCase for variables.

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


More information about the llvm-commits mailing list