[llvm] [XCOFF][obj2yaml] Support SymbolAlignmentAndType as 2 separate fields in YAML. (PR #76828)
James Henderson via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 8 00:53:57 PST 2024
================
@@ -525,11 +526,19 @@ bool XCOFFWriter::writeRelocations() {
}
void XCOFFWriter::writeAuxSymbol(const XCOFFYAML::CsectAuxEnt &AuxSym) {
+ uint8_t SymAlignAndType = AuxSym.SymbolAlignmentAndType.value_or(0);
+ if (AuxSym.SymbolType)
+ SymAlignAndType = (SymAlignAndType & ~XCOFFCsectAuxRef::SymbolTypeMask) |
+ *AuxSym.SymbolType;
+ if (AuxSym.SymbolAlignment)
+ SymAlignAndType =
+ (SymAlignAndType & ~XCOFFCsectAuxRef::SymbolAlignmentMask) |
+ (*AuxSym.SymbolAlignment << XCOFFCsectAuxRef::SymbolAlignmentBitOffset);
----------------
jh7370 wrote:
In similar cases in ELF yaml2obj, it is an error to specify both forms. I think the same should apply here (and be tested of course).
https://github.com/llvm/llvm-project/pull/76828
More information about the llvm-commits
mailing list