Skip to content

Commit 7ba4c75

Browse files
committed
Make alignment of PR always the same as ED
1 parent 005bd75 commit 7ba4c75

File tree

5 files changed

+22
-24
lines changed

5 files changed

+22
-24
lines changed

llvm/include/llvm/MC/MCGOFFAttributes.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ struct PRAttr {
7676
GOFF::ESDExecutable Executable = GOFF::ESD_EXE_Unspecified;
7777
GOFF::ESDLinkageType Linkage = GOFF::ESD_LT_XPLink;
7878
GOFF::ESDBindingScope BindingScope = GOFF::ESD_BSC_Unspecified;
79-
GOFF::ESDAlignment Alignment = GOFF::ESD_ALIGN_Byte;
8079
uint32_t SortKey = 0;
8180
};
8281

llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2800,13 +2800,13 @@ MCSection *TargetLoweringObjectFileGOFF::getSectionForLSDA(
28002800
GOFF::EDAttr{false, GOFF::RMODE, GOFF::ESD_NS_Parts,
28012801
GOFF::ESD_TS_ByteOriented, GOFF::ESD_BA_Merge,
28022802
GOFF::LOADBEHAVIOR, GOFF::ESD_RQ_0,
2803-
GOFF::ESD_ALIGN_Doubleword},
2803+
GOFF::ESD_ALIGN_Fullword},
28042804
static_cast<MCSectionGOFF *>(TextSection)->getParent());
2805-
return getContext().getGOFFSection(
2806-
SectionKind::getData(), Name,
2807-
GOFF::PRAttr{true, GOFF::ESD_EXE_DATA, GOFF::LINKAGE,
2808-
GOFF::ESD_BSC_Section, GOFF::ESD_ALIGN_Fullword, 0},
2809-
WSA);
2805+
return getContext().getGOFFSection(SectionKind::getData(), Name,
2806+
GOFF::PRAttr{true, GOFF::ESD_EXE_DATA,
2807+
GOFF::LINKAGE,
2808+
GOFF::ESD_BSC_Section, 0},
2809+
WSA);
28102810
}
28112811

28122812
MCSection *TargetLoweringObjectFileGOFF::SelectSectionForGlobal(
@@ -2837,7 +2837,7 @@ MCSection *TargetLoweringObjectFileGOFF::SelectSectionForGlobal(
28372837
return getContext().getGOFFSection(Kind, Symbol->getName(),
28382838
GOFF::PRAttr{false, GOFF::ESD_EXE_DATA,
28392839
GOFF::LINKAGE,
2840-
PRBindingScope, Align, 0},
2840+
PRBindingScope, 0},
28412841
ED);
28422842
}
28432843
return TextSection;

llvm/lib/MC/GOFFObjectWriter.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,14 +258,14 @@ class GOFFSymbol {
258258
}
259259

260260
GOFFSymbol(StringRef Name, uint32_t EsdID, uint32_t ParentEsdID,
261-
GOFF::ESDNameSpaceId NameSpace, const GOFF::PRAttr &Attr)
261+
const GOFF::EDAttr &EDAttr, const GOFF::PRAttr &Attr)
262262
: Name(Name.data(), Name.size()), EsdId(EsdID), ParentEsdId(ParentEsdID),
263-
SymbolType(GOFF::ESD_ST_PartReference), NameSpace(NameSpace) {
263+
SymbolType(GOFF::ESD_ST_PartReference), NameSpace(EDAttr.NameSpace) {
264264
SymbolFlags.setRenameable(Attr.IsRenamable);
265265
BehavAttrs.setExecutable(Attr.Executable);
266-
BehavAttrs.setAlignment(Attr.Alignment);
267266
BehavAttrs.setLinkageType(Attr.Linkage);
268267
BehavAttrs.setBindingScope(Attr.BindingScope);
268+
BehavAttrs.setAlignment(EDAttr.Alignment);
269269
}
270270
};
271271

@@ -307,8 +307,7 @@ void GOFFWriter::defineSectionSymbols(const MCSectionGOFF &Section) {
307307
if (Section.isPR()) {
308308
MCSectionGOFF *Parent = Section.getParent();
309309
GOFFSymbol PR(Section.getName(), Section.getOrdinal(), Parent->getOrdinal(),
310-
Parent->getEDAttributes().NameSpace,
311-
Section.getPRAttributes());
310+
Parent->getEDAttributes(), Section.getPRAttributes());
312311
PR.SectionLength = Asm.getSectionAddressSize(Section);
313312
if (Section.requiresNonZeroLength()) {
314313
// We cannot have a zero-length section for data. If we do,

llvm/lib/MC/MCObjectFileInfo.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,11 @@ void MCObjectFileInfo::initGOFFMCObjectFileInfo(const Triple &T) {
558558
GOFF::ESD_LB_Deferred, GOFF::ESD_RQ_1,
559559
GOFF::ESD_ALIGN_Quadword},
560560
RootSDSection);
561-
ADASection = Ctx->getGOFFSection(
562-
SectionKind::getData(), "#S",
563-
GOFF::PRAttr{false, GOFF::ESD_EXE_DATA, GOFF::ESD_LT_XPLink,
564-
GOFF::ESD_BSC_Section, GOFF::ESD_ALIGN_Quadword, 0},
565-
ADAEDSection);
561+
ADASection = Ctx->getGOFFSection(SectionKind::getData(), "#S",
562+
GOFF::PRAttr{false, GOFF::ESD_EXE_DATA,
563+
GOFF::ESD_LT_XPLink,
564+
GOFF::ESD_BSC_Section, 0},
565+
ADAEDSection);
566566

567567
TextSection = Ctx->getGOFFSection(
568568
SectionKind::getText(), GOFF::CLASS_CODE,
@@ -579,11 +579,11 @@ void MCObjectFileInfo::initGOFFMCObjectFileInfo(const Triple &T) {
579579
GOFF::ESD_LB_Initial, GOFF::ESD_RQ_0,
580580
GOFF::ESD_ALIGN_Doubleword},
581581
RootSDSection);
582-
PPA2ListSection = Ctx->getGOFFSection(
583-
SectionKind::getData(), ".&ppa2",
584-
GOFF::PRAttr{true, GOFF::ESD_EXE_DATA, GOFF::ESD_LT_OS,
585-
GOFF::ESD_BSC_Section, GOFF::ESD_ALIGN_Doubleword, 0},
586-
PPA2ListEDSection);
582+
PPA2ListSection = Ctx->getGOFFSection(SectionKind::getData(), ".&ppa2",
583+
GOFF::PRAttr{true, GOFF::ESD_EXE_DATA,
584+
GOFF::ESD_LT_OS,
585+
GOFF::ESD_BSC_Section, 0},
586+
PPA2ListEDSection);
587587

588588
IDRLSection = Ctx->getGOFFSection(
589589
SectionKind::getData(), "B_IDRL",

llvm/lib/MC/MCSectionGOFF.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ void MCSectionGOFF::printSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
123123
ED->getParent()->printSwitchToSection(MAI, T, OS, Subsection);
124124
if (!Emitted) {
125125
emitCATTR(OS, ED->getName(), ED->getEDAttributes().Rmode,
126-
PRAttributes.Alignment, ED->EDAttributes.LoadBehavior,
126+
ED->EDAttributes.Alignment, ED->EDAttributes.LoadBehavior,
127127
PRAttributes.Executable, ED->EDAttributes.IsReadOnly,
128128
PRAttributes.SortKey, Name);
129129
emitXATTR(OS, Name, PRAttributes.Linkage, PRAttributes.Executable,

0 commit comments

Comments
 (0)