aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-12 19:17:23 +0000
committerChris Lattner <sabre@nondot.org>2006-01-12 19:17:23 +0000
commit5166b82866085db7ecb8a3fef790232faeec74ed (patch)
tree55ae6a49c75a27e08c05bb221d442c8952e536b5 /lib/CodeGen/AsmPrinter.cpp
parentaf551bcf6be6c2c44b1b5dac5573c58bdc3da972 (diff)
If using __main, emit global ctor/dtor list like any other global
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25251 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--lib/CodeGen/AsmPrinter.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index 5fdfbfd5a3..377f0d82e3 100644
--- a/lib/CodeGen/AsmPrinter.cpp
+++ b/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());