summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86AsmPrinter.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-01-30 08:04:53 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-01-30 08:04:53 +0000
commit0e083d0161bbfcf5b1e481e6fc1cc29d023b93d6 (patch)
treeec7186096a30d60949160639ba93ea9c07155512 /llvm/lib/Target/X86/X86AsmPrinter.cpp
parentce8fa3ed83260327cfa7cab1f376149acddfc8ca (diff)
downloadbcm5719-llvm-0e083d0161bbfcf5b1e481e6fc1cc29d023b93d6.tar.gz
bcm5719-llvm-0e083d0161bbfcf5b1e481e6fc1cc29d023b93d6.zip
Darwin -static should codegen static ctors / dtors to .constructor / .destructor sections.
llvm-svn: 33657
Diffstat (limited to 'llvm/lib/Target/X86/X86AsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/X86/X86AsmPrinter.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index ff85828c5a5..0e9171bb711 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/lib/Target/X86/X86AsmPrinter.cpp
@@ -134,8 +134,16 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
continue; // External global require no code
// Check to see if this is a special global used by LLVM, if so, emit it.
- if (EmitSpecialLLVMGlobal(I))
+ if (EmitSpecialLLVMGlobal(I)) {
+ if (Subtarget->isTargetDarwin() &&
+ TM.getRelocationModel() == Reloc::Static) {
+ if (I->getName() == "llvm.global_ctors")
+ O << ".reference .constructors_used\n";
+ else if (I->getName() == "llvm.global_dtors")
+ O << ".reference .destructors_used\n";
+ }
continue;
+ }
std::string name = Mang->getValueName(I);
Constant *C = I->getInitializer();
OpenPOWER on IntegriCloud