diff options
author | Xing Xue <xingxue@outlook.com> | 2019-08-25 15:17:25 +0000 |
---|---|---|
committer | Xing Xue <xingxue@outlook.com> | 2019-08-25 15:17:25 +0000 |
commit | ef039a3ccdcd39c558c1d1a360b59bbb9bb11af5 (patch) | |
tree | f2823223d2dc5604a4852e70219df5402ff2729e /llvm/lib/MC/MCSectionXCOFF.cpp | |
parent | 76f005535addf2ac4817c4f3a1c50330c44a6b57 (diff) | |
download | bcm5719-llvm-ef039a3ccdcd39c558c1d1a360b59bbb9bb11af5.tar.gz bcm5719-llvm-ef039a3ccdcd39c558c1d1a360b59bbb9bb11af5.zip |
[PowerPC][AIX] Adds support for writing the .data section in assembly files
Summary:
Adds support for generating the .data section in assembly files for global variables with a non-zero initialization. The support for writing the .data section in XCOFF object files will be added in a follow-on patch. Any relocations are not included in this patch.
Reviewers: hubert.reinterpretcast, sfertile, jasonliu, daltenty, Xiangling_L
Reviewed by: hubert.reinterpretcast
Subscribers: nemanjai, hiraditya, kbarton, MaskRay, jsji, wuzish, shchenz, DiggerLin, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D66154
llvm-svn: 369869
Diffstat (limited to 'llvm/lib/MC/MCSectionXCOFF.cpp')
-rw-r--r-- | llvm/lib/MC/MCSectionXCOFF.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCSectionXCOFF.cpp b/llvm/lib/MC/MCSectionXCOFF.cpp index d00a435b625..db277521db2 100644 --- a/llvm/lib/MC/MCSectionXCOFF.cpp +++ b/llvm/lib/MC/MCSectionXCOFF.cpp @@ -28,6 +28,16 @@ void MCSectionXCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T, return; } + if (getKind().isData()) { + assert(getMappingClass() == XCOFF::XMC_RW && + "Unhandled storage-mapping class for data section."); + + OS << "\t.csect " << getSectionName() << "[" + << "RW" + << "]" << '\n'; + return; + } + if (getKind().isBSSLocal() || getKind().isCommon()) { assert((getMappingClass() == XCOFF::XMC_RW || getMappingClass() == XCOFF::XMC_BS) && |