[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
diff --git a/llvm/lib/MC/MCSectionXCOFF.cpp b/llvm/lib/MC/MCSectionXCOFF.cpp
index d00a435..db27752 100644
--- a/llvm/lib/MC/MCSectionXCOFF.cpp
+++ b/llvm/lib/MC/MCSectionXCOFF.cpp
@@ -28,6 +28,16 @@
     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) &&