summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCSectionXCOFF.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/MC/MCSectionXCOFF.cpp')
-rw-r--r--llvm/lib/MC/MCSectionXCOFF.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/MC/MCSectionXCOFF.cpp b/llvm/lib/MC/MCSectionXCOFF.cpp
index d00e9322897..f646168d3a4 100644
--- a/llvm/lib/MC/MCSectionXCOFF.cpp
+++ b/llvm/lib/MC/MCSectionXCOFF.cpp
@@ -27,6 +27,13 @@ void MCSectionXCOFF::PrintSwitchToSection(const MCAsmInfo &MAI, const Triple &T,
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:
OpenPOWER on IntegriCloud