diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2006-12-08 21:24:58 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2006-12-08 21:24:58 +0000 |
commit | 1366626e08322aaecd60704d02a5d881b0826725 (patch) | |
tree | 605f4acaeb1c925734d0625435d5f95d2082069f | |
parent | 975f05852d15c98540b50de7df704d67e5a794cd (diff) |
add \"aw\",@progbits" to ctors and dtors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32373 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Target/ARM/ARMAsmPrinter.cpp | 15 | ||||
-rw-r--r-- | test/CodeGen/ARM/section.ll | 1 |
2 files changed, 12 insertions, 4 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index a00e361eb5..3e79712349 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"; diff --git a/test/CodeGen/ARM/section.ll b/test/CodeGen/ARM/section.ll index cd33c12f41..ecda87b05b 100644 --- a/test/CodeGen/ARM/section.ll +++ b/test/CodeGen/ARM/section.ll @@ -1,4 +1,5 @@ ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm && ; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "__DTOR_END__:" +; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep ".section .dtors,\"aw\",@progbits" %__DTOR_END__ = internal global [1 x int] zeroinitializer, section ".dtors" |