add \"aw\",@progbits" to ctors and dtors

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32373 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2006-12-08 21:24:58 +00:00
parent 975f05852d
commit 1366626e08
2 changed files with 12 additions and 4 deletions

View File

@ -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";

View File

@ -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"