diff options
author | Chris Lattner <sabre@nondot.org> | 2006-01-12 19:17:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-01-12 19:17:23 +0000 |
commit | 3760e901cf2cf085d8063ff292a2ecb628a38175 (patch) | |
tree | 6281374afc14868ff4ddf8922c97a0ec45d5de12 /llvm/lib/CodeGen | |
parent | b1ee616de99c5964f85bcff863930bf9fd7e42d3 (diff) | |
download | bcm5719-llvm-3760e901cf2cf085d8063ff292a2ecb628a38175.tar.gz bcm5719-llvm-3760e901cf2cf085d8063ff292a2ecb628a38175.zip |
If using __main, emit global ctor/dtor list like any other global
llvm-svn: 25251
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp index 5fdfbfd5a30..377f0d82e38 100644 --- a/llvm/lib/CodeGen/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter.cpp @@ -120,14 +120,14 @@ bool AsmPrinter::EmitSpecialLLVMGlobal(const GlobalVariable *GV) { if (GV->getName() == "llvm.used") return true; // No need to emit this at all. - if (GV->getName() == "llvm.global_ctors") { + if (GV->getName() == "llvm.global_ctors" && GV->use_empty()) { SwitchSection(StaticCtorsSection, 0); EmitAlignment(2, 0); EmitXXStructorList(GV->getInitializer()); return true; } - if (GV->getName() == "llvm.global_dtors") { + if (GV->getName() == "llvm.global_dtors" && GV->use_empty()) { SwitchSection(StaticDtorsSection, 0); EmitAlignment(2, 0); EmitXXStructorList(GV->getInitializer()); |