1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 19:52:54 +01:00

Honor user-defined section specification of a global, ignores whether its initializer is null.

llvm-svn: 42182
This commit is contained in:
Evan Cheng 2007-09-21 00:41:19 +00:00
parent 346a949bd8
commit d675ed5400
3 changed files with 7 additions and 8 deletions

View File

@ -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);

View File

@ -661,9 +661,9 @@ bool LinuxAsmPrinter::doFinalization(Module &M) {
unsigned Align = TD->getPreferredAlignmentLog(I);
if (C->isNullValue() && /* FIXME: Verify correct */
!I->hasSection() &&
(I->hasInternalLinkage() || I->hasWeakLinkage() ||
I->hasLinkOnceLinkage() ||
(I->hasExternalLinkage() && !I->hasSection()))) {
I->hasLinkOnceLinkage() || I->hasExternalLinkage())) {
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
if (I->hasExternalLinkage()) {
O << "\t.global " << name << '\n';

View File

@ -170,7 +170,7 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
if (Subtarget->isTargetELF())
O << "\t.type\t" << 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";
@ -180,7 +180,7 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
}
}
if (!I->hasSection() && !I->isThreadLocal() &&
if (!I->isThreadLocal() &&
(I->hasInternalLinkage() || I->hasWeakLinkage() ||
I->hasLinkOnceLinkage())) {
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.