aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/MC/MCObjectFileInfo.cpp
diff options
context:
space:
mode:
authorAnirudh Prasad <anirudh_prasad@hotmail.com>2021-07-27 11:26:00 -0400
committerAnirudh Prasad <anirudh_prasad@hotmail.com>2021-07-27 11:29:15 -0400
commita8cfa4b9bda3014a88e089cadcc6d366317aec5b (patch)
treec3b057352f74db78c1201f31061d70df0aa50971 /llvm/lib/MC/MCObjectFileInfo.cpp
parent8ee5759fd50d147328f9e2a7ca9d6894721d0770 (diff)
downloadllvm-a8cfa4b9bda3014a88e089cadcc6d366317aec5b.zip
llvm-a8cfa4b9bda3014a88e089cadcc6d366317aec5b.tar.gz
llvm-a8cfa4b9bda3014a88e089cadcc6d366317aec5b.tar.bz2
[SystemZ][z/OS] Initial code to generate assembly files on z/OS
- This patch consists of the bare basic code needed in order to generate some assembly for the z/OS target. - Only the .text and the .bss sections are added for now. - The relevant MCSectionGOFF/Symbol interfaces have been added. This enables us to print out the GOFF machine code sections. - This patch enables us to add simple lit tests wherever possible, and contribute to the testing coverage for the z/OS target - Further improvements and additions will be made in future patches. Reviewed By: tmatheson Differential Revision: https://reviews.llvm.org/D106380
Diffstat (limited to 'llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r--llvm/lib/MC/MCObjectFileInfo.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCObjectFileInfo.cpp b/llvm/lib/MC/MCObjectFileInfo.cpp
index 1a448f0..7ea1106 100644
--- a/llvm/lib/MC/MCObjectFileInfo.cpp
+++ b/llvm/lib/MC/MCObjectFileInfo.cpp
@@ -17,6 +17,7 @@
#include "llvm/MC/MCSection.h"
#include "llvm/MC/MCSectionCOFF.h"
#include "llvm/MC/MCSectionELF.h"
+#include "llvm/MC/MCSectionGOFF.h"
#include "llvm/MC/MCSectionMachO.h"
#include "llvm/MC/MCSectionWasm.h"
#include "llvm/MC/MCSectionXCOFF.h"
@@ -504,6 +505,11 @@ void MCObjectFileInfo::initELFMCObjectFileInfo(const Triple &T, bool Large) {
Ctx->getELFSection(".pseudo_probe_desc", DebugSecType, 0);
}
+void MCObjectFileInfo::initGOFFMCObjectFileInfo(const Triple &T) {
+ TextSection = Ctx->getGOFFSection(".text", SectionKind::getText());
+ BSSSection = Ctx->getGOFFSection(".bss", SectionKind::getBSS());
+}
+
void MCObjectFileInfo::initCOFFMCObjectFileInfo(const Triple &T) {
EHFrameSection =
Ctx->getCOFFSection(".eh_frame", COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
@@ -995,6 +1001,9 @@ void MCObjectFileInfo::initMCObjectFileInfo(MCContext &MCCtx, bool PIC,
case MCContext::IsELF:
initELFMCObjectFileInfo(TheTriple, LargeCodeModel);
break;
+ case MCContext::IsGOFF:
+ initGOFFMCObjectFileInfo(TheTriple);
+ break;
case MCContext::IsWasm:
initWasmMCObjectFileInfo(TheTriple);
break;