diff options
author | Dale Johannesen <dalej@apple.com> | 2008-01-23 00:58:14 +0000 |
---|---|---|
committer | Dale Johannesen <dalej@apple.com> | 2008-01-23 00:58:14 +0000 |
commit | 25edeb32e77fdabbb986787a91a46435dfbaf716 (patch) | |
tree | 2635bdb8686d62bf3a4361a340bd64c43bc95137 /lib | |
parent | 97ca75e4bbab7f680564c96e6a326cd1ea267ce2 (diff) | |
download | external_llvm-25edeb32e77fdabbb986787a91a46435dfbaf716.zip external_llvm-25edeb32e77fdabbb986787a91a46435dfbaf716.tar.gz external_llvm-25edeb32e77fdabbb986787a91a46435dfbaf716.tar.bz2 |
Honor explicit section information on Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/ARM/ARMAsmPrinter.cpp | 4 | ||||
-rw-r--r-- | lib/Target/PowerPC/PPCAsmPrinter.cpp | 7 | ||||
-rw-r--r-- | lib/Target/X86/X86AsmPrinter.cpp | 5 |
3 files changed, 13 insertions, 3 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index 416084a..1203967 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -908,6 +908,10 @@ bool ARMAsmPrinter::doFinalization(Module &M) { std::string SectionName = ".section " + I->getSection(); SectionName += ",\"aw\",%progbits"; SwitchToDataSection(SectionName.c_str()); + } else if (I->hasSection() && Subtarget->isTargetDarwin()) { + // Honor all section names on Darwin; ObjC uses this + std::string SectionName = ".section " + I->getSection(); + SwitchToDataSection(SectionName.c_str()); } else { if (C->isNullValue() && !NoZerosInBSS && TAI->getBSSSection()) SwitchToDataSection(I->isThreadLocal() ? TAI->getTLSBSSSection() : diff --git a/lib/Target/PowerPC/PPCAsmPrinter.cpp b/lib/Target/PowerPC/PPCAsmPrinter.cpp index d5367dc..bab1af3 100644 --- a/lib/Target/PowerPC/PPCAsmPrinter.cpp +++ b/lib/Target/PowerPC/PPCAsmPrinter.cpp @@ -958,8 +958,11 @@ bool DarwinAsmPrinter::doFinalization(Module &M) { break; } } - - if (!I->isConstant()) + if (I->hasSection()) { + // Honor all section names on Darwin; ObjC uses this + std::string SectionName = ".section " + I->getSection(); + SwitchToDataSection(SectionName.c_str()); + } else if (!I->isConstant()) SwitchToDataSection(TAI->getDataSection(), I); else { // Read-only data. diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index ef8cbea..0b8c31c 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/lib/Target/X86/X86AsmPrinter.cpp @@ -275,7 +275,10 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) { assert(!Subtarget->isTargetDarwin()); SectionName += ",\"aw\",@progbits"; } - + SwitchToDataSection(SectionName.c_str()); + } else if (I->hasSection() && Subtarget->isTargetDarwin()) { + // Honor all section names on Darwin; ObjC uses this + std::string SectionName = ".section " + I->getSection(); SwitchToDataSection(SectionName.c_str()); } else { if (C->isNullValue() && !NoZerosInBSS && TAI->getBSSSection()) |