Skip to content

[SystemZ] [z/OS] Emit offset to PPA2 in separate MCSection #84043

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions llvm/include/llvm/MC/MCObjectFileInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ class MCObjectFileInfo {
// GOFF specific sections.
MCSection *PPA1Section = nullptr;
MCSection *PPA2Section = nullptr;
MCSection *PPA2ListSection = nullptr;
MCSection *ADASection = nullptr;
MCSection *IDRLSection = nullptr;

Expand Down Expand Up @@ -434,6 +435,7 @@ class MCObjectFileInfo {
// GOFF specific sections.
MCSection *getPPA1Section() const { return PPA1Section; }
MCSection *getPPA2Section() const { return PPA2Section; }
MCSection *getPPA2ListSection() const { return PPA2ListSection; }
MCSection *getADASection() const { return ADASection; }
MCSection *getIDRLSection() const { return IDRLSection; }

Expand Down
5 changes: 5 additions & 0 deletions llvm/lib/MC/MCObjectFileInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,11 @@ void MCObjectFileInfo::initGOFFMCObjectFileInfo(const Triple &T) {
PPA2Section =
Ctx->getGOFFSection(".ppa2", SectionKind::getMetadata(), TextSection,
MCConstantExpr::create(GOFF::SK_PPA2, *Ctx));

PPA2ListSection =
Ctx->getGOFFSection(".ppa2list", SectionKind::getData(),
nullptr, nullptr);

ADASection =
Ctx->getGOFFSection(".ada", SectionKind::getData(), nullptr, nullptr);
IDRLSection =
Expand Down
3 changes: 3 additions & 0 deletions llvm/lib/Target/SystemZ/SystemZAsmPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1531,6 +1531,9 @@ void SystemZAsmPrinter::emitPPA2(Module &M) {

OutStreamer->emitInt16(0x0000); // Service level string length.

// The binder requires that the offset to the PPA2 be emitted in a different,
// specially-named section.
OutStreamer->switchSection(getObjFileLowering().getPPA2ListSection());
// Emit 8 byte alignment.
// Emit pointer to PPA2 label.
OutStreamer->AddComment("A(PPA2-CELQSTRT)");
Expand Down