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:
parent
346a949bd8
commit
d675ed5400
@ -835,7 +835,7 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
|
|||||||
if (Subtarget->isTargetELF())
|
if (Subtarget->isTargetELF())
|
||||||
O << "\t.type " << name << ",%object\n";
|
O << "\t.type " << name << ",%object\n";
|
||||||
|
|
||||||
if (C->isNullValue()) {
|
if (C->isNullValue() && !I->hasSection()) {
|
||||||
if (I->hasExternalLinkage()) {
|
if (I->hasExternalLinkage()) {
|
||||||
if (const char *Directive = TAI->getZeroFillDirective()) {
|
if (const char *Directive = TAI->getZeroFillDirective()) {
|
||||||
O << "\t.globl\t" << name << "\n";
|
O << "\t.globl\t" << name << "\n";
|
||||||
@ -845,9 +845,8 @@ bool ARMAsmPrinter::doFinalization(Module &M) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!I->hasSection() &&
|
if (I->hasInternalLinkage() || I->hasWeakLinkage() ||
|
||||||
(I->hasInternalLinkage() || I->hasWeakLinkage() ||
|
I->hasLinkOnceLinkage()) {
|
||||||
I->hasLinkOnceLinkage())) {
|
|
||||||
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
|
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
|
||||||
if (!NoZerosInBSS && TAI->getBSSSection())
|
if (!NoZerosInBSS && TAI->getBSSSection())
|
||||||
SwitchToDataSection(TAI->getBSSSection(), I);
|
SwitchToDataSection(TAI->getBSSSection(), I);
|
||||||
|
@ -661,9 +661,9 @@ bool LinuxAsmPrinter::doFinalization(Module &M) {
|
|||||||
unsigned Align = TD->getPreferredAlignmentLog(I);
|
unsigned Align = TD->getPreferredAlignmentLog(I);
|
||||||
|
|
||||||
if (C->isNullValue() && /* FIXME: Verify correct */
|
if (C->isNullValue() && /* FIXME: Verify correct */
|
||||||
|
!I->hasSection() &&
|
||||||
(I->hasInternalLinkage() || I->hasWeakLinkage() ||
|
(I->hasInternalLinkage() || I->hasWeakLinkage() ||
|
||||||
I->hasLinkOnceLinkage() ||
|
I->hasLinkOnceLinkage() || I->hasExternalLinkage())) {
|
||||||
(I->hasExternalLinkage() && !I->hasSection()))) {
|
|
||||||
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
|
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
|
||||||
if (I->hasExternalLinkage()) {
|
if (I->hasExternalLinkage()) {
|
||||||
O << "\t.global " << name << '\n';
|
O << "\t.global " << name << '\n';
|
||||||
|
@ -170,7 +170,7 @@ bool X86SharedAsmPrinter::doFinalization(Module &M) {
|
|||||||
if (Subtarget->isTargetELF())
|
if (Subtarget->isTargetELF())
|
||||||
O << "\t.type\t" << name << ",@object\n";
|
O << "\t.type\t" << name << ",@object\n";
|
||||||
|
|
||||||
if (C->isNullValue()) {
|
if (C->isNullValue() && !I->hasSection()) {
|
||||||
if (I->hasExternalLinkage()) {
|
if (I->hasExternalLinkage()) {
|
||||||
if (const char *Directive = TAI->getZeroFillDirective()) {
|
if (const char *Directive = TAI->getZeroFillDirective()) {
|
||||||
O << "\t.globl\t" << name << "\n";
|
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->hasInternalLinkage() || I->hasWeakLinkage() ||
|
||||||
I->hasLinkOnceLinkage())) {
|
I->hasLinkOnceLinkage())) {
|
||||||
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
|
if (Size == 0) Size = 1; // .comm Foo, 0 is undefined, avoid it.
|
||||||
|
Loading…
Reference in New Issue
Block a user