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 | 0e083d0161bbfcf5b1e481e6fc1cc29d023b93d6 (patch) | |
| tree | ec7186096a30d60949160639ba93ea9c07155512 /llvm/lib/Target/PowerPC/PPCTargetAsmInfo.cpp | |
| parent | ce8fa3ed83260327cfa7cab1f376149acddfc8ca (diff) | |
| download | bcm5719-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.cpp | 9 |
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"; |

