aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target/ARM/ARMAsmPrinter.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-09-21 00:41:19 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-09-21 00:41:19 +0000
commit76a4023096fc330db11d711197388d9f3ba91cc6 (patch)
tree10859d53a81043bca6543361d83510239ff25913 /lib/Target/ARM/ARMAsmPrinter.cpp
parenta72a5a095d0161f9258e75f38436698e9d75b879 (diff)
downloadexternal_llvm-76a4023096fc330db11d711197388d9f3ba91cc6.zip
external_llvm-76a4023096fc330db11d711197388d9f3ba91cc6.tar.gz
external_llvm-76a4023096fc330db11d711197388d9f3ba91cc6.tar.bz2
Honor user-defined section specification of a global, ignores whether its initializer is null.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42182 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMAsmPrinter.cpp')
-rw-r--r--lib/Target/ARM/ARMAsmPrinter.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp
index f637dec..342e52a 100644
--- a/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -835,7 +835,7 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
if (Subtarget->isTargetELF())
O << "\t.type " << name << ",%object\n";
- if (C->isNullValue()) {
+ if (C->isNullValue() && !I->hasSection()) {
if (I->hasExternalLinkage()) {
if (const char *Directive = TAI->getZeroFillDirective()) {
O << "\t.globl\t" << name << "\n";
@@ -845,9 +845,8 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
}
}
- if (!I->hasSection() &&
- (I->hasInternalLinkage() || I->hasWeakLinkage() ||
- I->hasLinkOnceLinkage())) {
+ if (I->hasInternalLinkage() || I->hasWeakLinkage() ||
+ I->hasLinkOnceLinkage()) {
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
if (!NoZerosInBSS && TAI->getBSSSection())
SwitchToDataSection(TAI->getBSSSection(), I);