diff options
author | Evan Cheng <evan.cheng@apple.com> | 2007-01-30 08:04:53 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2007-01-30 08:04:53 +0000 |
commit | b267ca17d1351b28d597e7807b5ed398e92d65e4 (patch) | |
tree | a0f86a89d6a9ee63e1b9e90c0da33bd8f465f269 /lib/Target/X86/X86AsmPrinter.cpp | |
parent | c322a9ac146358c09279e59846872565a8b01b50 (diff) |
Darwin -static should codegen static ctors / dtors to .constructor / .destructor sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33657 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86AsmPrinter.cpp')
-rw-r--r-- | lib/Target/X86/X86AsmPrinter.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index ff85828c5a..0e9171bb71 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/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(); |