summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.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/PowerPC/PPCTargetAsmInfo.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/PowerPC/PPCTargetAsmInfo.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
index 0fc8481b742..2442a38366f 100644
--- a/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
+++ b/llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
@@ -53,8 +53,13 @@ DarwinTargetAsmInfo::DarwinTargetAsmInfo(const PPCTargetMachine &TM)
JumpTableDataSection = ".const";
GlobalDirective = "\t.globl\t";
CStringSection = "\t.cstring";
- StaticCtorsSection = ".mod_init_func";
- StaticDtorsSection = ".mod_term_func";
+ if (TM.getRelocationModel() == Reloc::Static) {
+ StaticCtorsSection = ".constructor";
+ StaticDtorsSection = ".destructor";
+ } else {
+ StaticCtorsSection = ".mod_init_func";
+ StaticDtorsSection = ".mod_term_func";
+ }
UsedDirective = "\t.no_dead_strip\t";
WeakRefDirective = "\t.weak_reference\t";
HiddenDirective = "\t.private_extern\t";
OpenPOWER on IntegriCloud