[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
================
@@ -535,6 +535,40 @@ GOFFObjectFile::getSymbolSection(DataRefImpl Symb) const {
std::to_string(SymEdId));
}
+uint32_t GOFFObjectFile::getZOSSymbolArchiveAttributes(DataRefImpl Symb) const {
+ const uint8_t *SymRecord = getSymbolEsdRecord(Symb);
+ uint32_t Attrs = 0;
+
+ // Bit 2 (0x4): 64-bit AMODE. If the child AMODE is unspecified,
+ // query the parent ED.
+ GOFF::ESDAmode Amode;
+ ESDRecord::getAmode(SymRecord, Amode);
+ if (Amode == GOFF::ESD_AMODE_None) {
+ uint32_t ParentEsdId;
+ ESDRecord::getParentEsdId(SymRecord, ParentEsdId);
+ if (ParentEsdId) {
+ const uint8_t *EdRecord = EsdPtrs[ParentEsdId];
+ ESDRecord::getAmode(EdRecord, Amode);
+ }
+ }
----------------
jh7370 wrote:
> I suppose testing these cases properly would also again, require full yaml2obj GOFF ESD record support and could be done in the future potentially?
Yes, this sounds like the sort of case that yaml2obj is ideal for (once support is added). After all, llvm-ar should be able to work with objects produced by non-LLVM tools, so we should have testing for all the cases that are possible under the specification (and error cases to show that invalid objects are appropriately handled too, of course).
For now, a TODO is fine again.
https://github.com/llvm/llvm-project/pull/214528
More information about the llvm-commits
mailing list