Add read-only data assembly writing for aix
SUMMARY:
The patch will emit read-only variable assembly code for aix.
Reviewers: daltenty,Xiangling_Liao
Subscribers: rupprecht, seiyai,hiraditya
Differential Revision: https://reviews.llvm.org/D70182
diff --git a/llvm/lib/MC/MCSectionXCOFF.cpp b/llvm/lib/MC/MCSectionXCOFF.cpp
index d00e932..f646168 100644
--- a/llvm/lib/MC/MCSectionXCOFF.cpp
+++ b/llvm/lib/MC/MCSectionXCOFF.cpp
@@ -27,6 +27,13 @@
return;
}
+ if (getKind().isReadOnly()) {
+ if (getMappingClass() != XCOFF::XMC_RO)
+ report_fatal_error("Unhandled storage-mapping class for .rodata csect.");
+ OS << "\t.csect " << QualName->getName() << '\n';
+ return;
+ }
+
if (getKind().isData()) {
switch (getMappingClass()) {
case XCOFF::XMC_RW: