aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Target/ARM/ARMAsmPrinter.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp
index a00e361..3e79712 100644
--- a/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -317,10 +317,17 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
break;
}
- if (C->isNullValue())
- SwitchToDataSection(".bss", I);
- else
- SwitchToDataSection(".data", I);
+ if (I->hasSection() &&
+ (I->getSection() == ".ctors" ||
+ I->getSection() == ".dtors")) {
+ std::string SectionName = ".section " + I->getSection();
+
+ SectionName += ",\"aw\",@progbits";
+
+ SwitchToDataSection(SectionName.c_str());
+ } else {
+ SwitchToDataSection(TAI->getDataSection(), I);
+ }
EmitAlignment(Align, I);
O << "\t.type " << name << ", %object\n";