aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-01-19 04:34:02 +0000
committerChris Lattner <sabre@nondot.org>2010-01-19 04:34:02 +0000
commit71eae713153e564ec743c5c4162ff258c255de78 (patch)
tree01b79de1395d38dbeefafc085c6255b8d688aa5e /lib/CodeGen
parenta756b1d914eaf4ad610d29398e5831b394bd1547 (diff)
move production of .reference directives for static ctor/dtor list on
darwin into common code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93849 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 3beb4d66ac..9a19f81e38 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -449,6 +449,10 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
OutStreamer.SwitchSection(getObjFileLowering().getStaticCtorSection());
EmitAlignment(Align, 0);
EmitXXStructorList(GV->getInitializer());
+
+ if (TM.getRelocationModel() == Reloc::Static &&
+ MAI->hasStaticCtorDtorReferenceInStaticMode())
+ O << ".reference .constructors_used\n";
return true;
}
@@ -456,6 +460,10 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) {
OutStreamer.SwitchSection(getObjFileLowering().getStaticDtorSection());
EmitAlignment(Align, 0);
EmitXXStructorList(GV->getInitializer());
+
+ if (TM.getRelocationModel() == Reloc::Static &&
+ MAI->hasStaticCtorDtorReferenceInStaticMode())
+ O << ".reference .destructors_used\n";
return true;
}