Fix the MASM asmprinter's lies. It does not want to emit code to .text/.data
it wants it emitted to _text/_data.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28185 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp
index 0e2bab7..dceade4 100644
--- a/lib/Target/X86/X86AsmPrinter.cpp
+++ b/lib/Target/X86/X86AsmPrinter.cpp
@@ -50,6 +50,8 @@
forDarwin = false;
PrivateGlobalPrefix = ".L";
+ DefaultTextSection = ".text";
+ DefaultDataSection = ".data";
switch (Subtarget->TargetType) {
case X86Subtarget::isDarwin:
@@ -119,7 +121,7 @@
O << "\t.zerofill __DATA__, __common, " << name << ", "
<< Size << ", " << Align;
} else {
- SwitchToDataSection(".data", I);
+ SwitchToDataSection(DefaultDataSection, I);
if (LCOMMDirective != NULL) {
if (I->hasInternalLinkage()) {
O << LCOMMDirective << name << "," << Size;
@@ -157,7 +159,7 @@
O << "\t.globl " << name << "\n";
// FALL THROUGH
case GlobalValue::InternalLinkage:
- SwitchToDataSection(".data", I);
+ SwitchToDataSection(DefaultDataSection, I);
break;
default:
assert(0 && "Unknown linkage type!");