[llvm] [XCOFF][obj2yaml] Support SymbolAlignmentAndType as 2 separate fields in YAML. (PR #76828)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 4 01:22:04 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);
----------------
EsmeYi wrote:
Please add a test case in yaml stating that SymbolAlignmentAndType will be overridden if SymbolType/SymbolAlignment is defined.
https://github.com/llvm/llvm-project/pull/76828
More information about the llvm-commits
mailing list