[llvm] [llvm-ar][GOFF] Implement symbol attributes for GOFF archives (PR #214528)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 7 01:55:06 PDT 2026
================
@@ -0,0 +1,73 @@
+## Test that llvm-ar correctly writes z/OS archive symbol attribute bits,
+## and that llvm-nm --print-armap reads them back correctly.
+##
+## The three attribute bits come from GOFF ESD record fields:
+## bit 2 (0x4): 64-bit - AMODE == ESD_AMODE_64
+## bit 1 (0x2): XPLink - LinkageType == ESD_LT_XPLink
+## bit 0 (0x1): WSA - parent ED NameSpaceId == ESD_NS_Parts
+##
+## GOFF objects are produced by compiling embedded .ll files with llc.
+
+# REQUIRES: systemz-registered-target
+
+# RUN: rm -rf %t.dir && mkdir -p %t.dir
+# RUN: split-file %s %t.dir
+
+## Compile each .ll file into a GOFF object.
+# RUN: llc -mtriple=s390x-ibm-zos -filetype=obj %t.dir/func.ll -o %t.dir/func.o
+# RUN: llc -mtriple=s390x-ibm-zos -filetype=obj %t.dir/data.ll -o %t.dir/data.o
+
+## Build a z/OS archive containing both objects.
+# RUN: llvm-ar rcD --format=zos %t.dir/test.a %t.dir/func.o %t.dir/data.o
+
+## 1. Check the archive map shows each symbol with the correct inline flags.
+# RUN: llvm-nm --print-armap %t.dir/test.a | FileCheck %s --check-prefix=ARMAP
+
+# ARMAP: Archive map
+# ARMAP-NEXT: s_func in func.o (flags: 0x00000006 [64-bit + XPLink])
+# ARMAP-NEXT: s_data in data.o (flags: 0x00000003 [XPLink + WSA])
----------------
jh7370 wrote:
Yes, a TODO would be fine for now.
https://github.com/llvm/llvm-project/pull/214528
More information about the llvm-commits
mailing list