move dwarf debug info section selection stuff from TAI to
TLOF, unifying all the dwarf targets at the same time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77889 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 873cdc2..3cb273f 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -1866,31 +1866,32 @@
 
   // Dwarf sections base addresses.
   if (TAI->doesDwarfRequireFrameSection()) {
-    Asm->SwitchToDataSection(TAI->getDwarfFrameSection());
+    Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfFrameSection());
     EmitLabel("section_debug_frame", 0);
   }
 
-  Asm->SwitchToDataSection(TAI->getDwarfInfoSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfInfoSection());
   EmitLabel("section_info", 0);
-  Asm->SwitchToDataSection(TAI->getDwarfAbbrevSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfAbbrevSection());
   EmitLabel("section_abbrev", 0);
-  Asm->SwitchToDataSection(TAI->getDwarfARangesSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfARangesSection());
   EmitLabel("section_aranges", 0);
 
-  if (const char *LineInfoDirective = TAI->getDwarfMacroInfoSection()) {
-    Asm->SwitchToDataSection(LineInfoDirective);
+  if (const MCSection *LineInfoDirective = 
+        Asm->getObjFileLowering().getDwarfMacroInfoSection()) {
+    Asm->SwitchToSection(LineInfoDirective);
     EmitLabel("section_macinfo", 0);
   }
 
-  Asm->SwitchToDataSection(TAI->getDwarfLineSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfLineSection());
   EmitLabel("section_line", 0);
-  Asm->SwitchToDataSection(TAI->getDwarfLocSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfLocSection());
   EmitLabel("section_loc", 0);
-  Asm->SwitchToDataSection(TAI->getDwarfPubNamesSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfPubNamesSection());
   EmitLabel("section_pubnames", 0);
-  Asm->SwitchToDataSection(TAI->getDwarfStrSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfStrSection());
   EmitLabel("section_str", 0);
-  Asm->SwitchToDataSection(TAI->getDwarfRangesSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfRangesSection());
   EmitLabel("section_ranges", 0);
 
   Asm->SwitchToSection(Asm->getObjFileLowering().getTextSection());
@@ -1997,7 +1998,7 @@
 
 void DwarfDebug::EmitDebugInfo() {
   // Start debug info section.
-  Asm->SwitchToDataSection(TAI->getDwarfInfoSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfInfoSection());
 
   EmitDebugInfoPerCU(ModuleCU);
 }
@@ -2008,7 +2009,7 @@
   // Check to see if it is worth the effort.
   if (!Abbreviations.empty()) {
     // Start the debug abbrev section.
-    Asm->SwitchToDataSection(TAI->getDwarfAbbrevSection());
+    Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfAbbrevSection());
 
     EmitLabel("abbrev_begin", 0);
 
@@ -2065,7 +2066,7 @@
   const int MaxLineDelta = 255 + MinLineDelta;
 
   // Start the dwarf line section.
-  Asm->SwitchToDataSection(TAI->getDwarfLineSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfLineSection());
 
   // Construct the section header.
   EmitDifference("line_end", 0, "line_begin", 0, true);
@@ -2225,7 +2226,7 @@
     TD->getPointerSize() : -TD->getPointerSize();
 
   // Start the dwarf frame section.
-  Asm->SwitchToDataSection(TAI->getDwarfFrameSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfFrameSection());
 
   EmitLabel("debug_frame_common", 0);
   EmitDifference("debug_frame_common_end", 0,
@@ -2265,7 +2266,7 @@
     return;
 
   // Start the dwarf frame section.
-  Asm->SwitchToDataSection(TAI->getDwarfFrameSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfFrameSection());
 
   EmitDifference("debug_frame_end", DebugFrameInfo.Number,
                  "debug_frame_begin", DebugFrameInfo.Number, true);
@@ -2329,7 +2330,7 @@
 ///
 void DwarfDebug::EmitDebugPubNames() {
   // Start the dwarf pubnames section.
-  Asm->SwitchToDataSection(TAI->getDwarfPubNamesSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfPubNamesSection());
 
   EmitDebugPubNamesPerCU(ModuleCU);
 }
@@ -2340,7 +2341,7 @@
   // Check to see if it is worth the effort.
   if (!StringPool.empty()) {
     // Start the dwarf str section.
-    Asm->SwitchToDataSection(TAI->getDwarfStrSection());
+    Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfStrSection());
 
     // For each of strings in the string pool.
     for (unsigned StringID = 1, N = StringPool.size();
@@ -2361,7 +2362,7 @@
 ///
 void DwarfDebug::EmitDebugLoc() {
   // Start the dwarf loc section.
-  Asm->SwitchToDataSection(TAI->getDwarfLocSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfLocSection());
   Asm->EOL();
 }
 
@@ -2369,7 +2370,7 @@
 ///
 void DwarfDebug::EmitDebugARanges() {
   // Start the dwarf aranges section.
-  Asm->SwitchToDataSection(TAI->getDwarfARangesSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfARangesSection());
 
   // FIXME - Mock up
 #if 0
@@ -2405,16 +2406,17 @@
 ///
 void DwarfDebug::EmitDebugRanges() {
   // Start the dwarf ranges section.
-  Asm->SwitchToDataSection(TAI->getDwarfRangesSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfRangesSection());
   Asm->EOL();
 }
 
 /// EmitDebugMacInfo - Emit visible names into a debug macinfo section.
 ///
 void DwarfDebug::EmitDebugMacInfo() {
-  if (const char *LineInfoDirective = TAI->getDwarfMacroInfoSection()) {
+  if (const MCSection *LineInfo = 
+      Asm->getObjFileLowering().getDwarfMacroInfoSection()) {
     // Start the dwarf macinfo section.
-    Asm->SwitchToDataSection(LineInfoDirective);
+    Asm->SwitchToSection(LineInfo);
     Asm->EOL();
   }
 }
@@ -2444,7 +2446,7 @@
   if (!ModuleCU)
     return;
 
-  Asm->SwitchToDataSection(TAI->getDwarfDebugInlineSection());
+  Asm->SwitchToSection(Asm->getObjFileLowering().getDwarfDebugInlineSection());
   Asm->EOL();
   EmitDifference("debug_inlined_end", 1,
                  "debug_inlined_begin", 1, true);
diff --git a/lib/Target/ARM/ARMTargetAsmInfo.cpp b/lib/Target/ARM/ARMTargetAsmInfo.cpp
index 3ff777c..e3348a9 100644
--- a/lib/Target/ARM/ARMTargetAsmInfo.cpp
+++ b/lib/Target/ARM/ARMTargetAsmInfo.cpp
@@ -57,17 +57,6 @@
   WeakRefDirective = "\t.weak\t";
   SetDirective = "\t.set\t";
   DwarfRequiresFrameSection = false;
-  DwarfAbbrevSection =  "\t.section\t.debug_abbrev,\"\",%progbits";
-  DwarfInfoSection =    "\t.section\t.debug_info,\"\",%progbits";
-  DwarfLineSection =    "\t.section\t.debug_line,\"\",%progbits";
-  DwarfFrameSection =   "\t.section\t.debug_frame,\"\",%progbits";
-  DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",%progbits";
-  DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",%progbits";
-  DwarfStrSection =     "\t.section\t.debug_str,\"\",%progbits";
-  DwarfLocSection =     "\t.section\t.debug_loc,\"\",%progbits";
-  DwarfARangesSection = "\t.section\t.debug_aranges,\"\",%progbits";
-  DwarfRangesSection =  "\t.section\t.debug_ranges,\"\",%progbits";
-  DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"\",%progbits";
 
   SupportsDebugInformation = true;
 }
diff --git a/lib/Target/COFFTargetAsmInfo.cpp b/lib/Target/COFFTargetAsmInfo.cpp
index 64f87c0..87e85ad 100644
--- a/lib/Target/COFFTargetAsmInfo.cpp
+++ b/lib/Target/COFFTargetAsmInfo.cpp
@@ -33,16 +33,5 @@
   AbsoluteEHSectionOffsets = false;
   SupportsDebugInformation = true;
   DwarfSectionOffsetDirective = "\t.secrel32\t";
-  DwarfAbbrevSection =  "\t.section\t.debug_abbrev,\"dr\"";
-  DwarfInfoSection =    "\t.section\t.debug_info,\"dr\"";
-  DwarfLineSection =    "\t.section\t.debug_line,\"dr\"";
-  DwarfFrameSection =   "\t.section\t.debug_frame,\"dr\"";
-  DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"dr\"";
-  DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"dr\"";
-  DwarfStrSection =     "\t.section\t.debug_str,\"dr\"";
-  DwarfLocSection =     "\t.section\t.debug_loc,\"dr\"";
-  DwarfARangesSection = "\t.section\t.debug_aranges,\"dr\"";
-  DwarfRangesSection =  "\t.section\t.debug_ranges,\"dr\"";
-  DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"dr\"";
 }
 
diff --git a/lib/Target/CellSPU/SPUTargetAsmInfo.cpp b/lib/Target/CellSPU/SPUTargetAsmInfo.cpp
index 66c25a8..2dcb113 100644
--- a/lib/Target/CellSPU/SPUTargetAsmInfo.cpp
+++ b/lib/Target/CellSPU/SPUTargetAsmInfo.cpp
@@ -34,17 +34,6 @@
 
   SupportsDebugInformation = true;
   NeedsSet = true;
-  DwarfAbbrevSection =  "\t.section        .debug_abbrev,\"\",@progbits";
-  DwarfInfoSection =    "\t.section        .debug_info,\"\",@progbits";
-  DwarfLineSection =    "\t.section        .debug_line,\"\",@progbits";
-  DwarfFrameSection =   "\t.section        .debug_frame,\"\",@progbits";
-  DwarfPubNamesSection = "\t.section        .debug_pubnames,\"\",@progbits";
-  DwarfPubTypesSection = "\t.section        .debug_pubtypes,\"\",progbits";
-  DwarfStrSection =     "\t.section        .debug_str,\"MS\",@progbits,1";
-  DwarfLocSection =     "\t.section        .debug_loc,\"\",@progbits";
-  DwarfARangesSection = "\t.section        .debug_aranges,\"\",@progbits";
-  DwarfRangesSection =  "\t.section        .debug_ranges,\"\",@progbits";
-  DwarfMacroInfoSection = 0;  // macro info not supported.
 
   // Exception handling is not supported on CellSPU (think about it: you only
   // have 256K for code+data. Would you support exception handling?)
diff --git a/lib/Target/DarwinTargetAsmInfo.cpp b/lib/Target/DarwinTargetAsmInfo.cpp
index 041dfa9..ad669f8 100644
--- a/lib/Target/DarwinTargetAsmInfo.cpp
+++ b/lib/Target/DarwinTargetAsmInfo.cpp
@@ -41,17 +41,5 @@
   // doesn't hurt anything.
   // FIXME: I need to get this from Triple.
   Is_EHSymbolPrivate = false;
-    
-  DwarfAbbrevSection = ".section __DWARF,__debug_abbrev,regular,debug";
-  DwarfInfoSection = ".section __DWARF,__debug_info,regular,debug";
-  DwarfLineSection = ".section __DWARF,__debug_line,regular,debug";
-  DwarfFrameSection = ".section __DWARF,__debug_frame,regular,debug";
-  DwarfPubNamesSection = ".section __DWARF,__debug_pubnames,regular,debug";
-  DwarfPubTypesSection = ".section __DWARF,__debug_pubtypes,regular,debug";
-  DwarfStrSection = ".section __DWARF,__debug_str,regular,debug";
-  DwarfLocSection = ".section __DWARF,__debug_loc,regular,debug";
-  DwarfARangesSection = ".section __DWARF,__debug_aranges,regular,debug";
-  DwarfRangesSection = ".section __DWARF,__debug_ranges,regular,debug";
-  DwarfMacroInfoSection = ".section __DWARF,__debug_macinfo,regular,debug";
 }
 
diff --git a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
index e8b1824..2612017 100644
--- a/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
+++ b/lib/Target/PowerPC/PPCTargetAsmInfo.cpp
@@ -41,17 +41,6 @@
   // Debug Information
   AbsoluteDebugSectionOffsets = true;
   SupportsDebugInformation = true;
-  DwarfAbbrevSection =  "\t.section\t.debug_abbrev,\"\",@progbits";
-  DwarfInfoSection =    "\t.section\t.debug_info,\"\",@progbits";
-  DwarfLineSection =    "\t.section\t.debug_line,\"\",@progbits";
-  DwarfFrameSection =   "\t.section\t.debug_frame,\"\",@progbits";
-  DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",@progbits";
-  DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",@progbits";
-  DwarfStrSection =     "\t.section\t.debug_str,\"\",@progbits";
-  DwarfLocSection =     "\t.section\t.debug_loc,\"\",@progbits";
-  DwarfARangesSection = "\t.section\t.debug_aranges,\"\",@progbits";
-  DwarfRangesSection =  "\t.section\t.debug_ranges,\"\",@progbits";
-  DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"\",@progbits";
 
   PCSymbol = ".";
 
diff --git a/lib/Target/TargetAsmInfo.cpp b/lib/Target/TargetAsmInfo.cpp
index 7da3715..921bf20 100644
--- a/lib/Target/TargetAsmInfo.cpp
+++ b/lib/Target/TargetAsmInfo.cpp
@@ -84,18 +84,7 @@
   GlobalEHDirective = 0;
   SupportsWeakOmittedEHFrame = true;
   DwarfSectionOffsetDirective = 0;
-  DwarfAbbrevSection = ".debug_abbrev";
-  DwarfInfoSection = ".debug_info";
-  DwarfLineSection = ".debug_line";
-  DwarfFrameSection = ".debug_frame";
-  DwarfPubNamesSection = ".debug_pubnames";
-  DwarfPubTypesSection = ".debug_pubtypes";
-  DwarfDebugInlineSection = ".debug_inlined";
-  DwarfStrSection = ".debug_str";
-  DwarfLocSection = ".debug_loc";
-  DwarfARangesSection = ".debug_aranges";
-  DwarfRangesSection = ".debug_ranges";
-  DwarfMacroInfoSection = ".debug_macinfo";
+
   AsmTransCBE = 0;
 }
 
diff --git a/lib/Target/TargetLoweringObjectFile.cpp b/lib/Target/TargetLoweringObjectFile.cpp
index 38ae71e..cb950af 100644
--- a/lib/Target/TargetLoweringObjectFile.cpp
+++ b/lib/Target/TargetLoweringObjectFile.cpp
@@ -38,6 +38,19 @@
   StaticDtorSection = 0;
   LSDASection = 0;
   EHFrameSection = 0;
+
+  DwarfAbbrevSection = 0;
+  DwarfInfoSection = 0;
+  DwarfLineSection = 0;
+  DwarfFrameSection = 0;
+  DwarfPubNamesSection = 0;
+  DwarfPubTypesSection = 0;
+  DwarfDebugInlineSection = 0;
+  DwarfStrSection = 0;
+  DwarfLocSection = 0;
+  DwarfARangesSection = 0;
+  DwarfRangesSection = 0;
+  DwarfMacroInfoSection = 0;
 }
 
 TargetLoweringObjectFile::~TargetLoweringObjectFile() {
@@ -305,6 +318,7 @@
   StaticDtorSection =
     getOrCreateSection(".dtors", false, SectionKind::getDataRel());
   
+  // Exception Handling Sections.
   
   // FIXME: We're emitting LSDA info into a readonly section on ELF, even though
   // it contains relocatable pointers.  In PIC mode, this is probably a big
@@ -314,6 +328,30 @@
     getOrCreateSection(".gcc_except_table", false, SectionKind::getReadOnly());
   EHFrameSection =
     getOrCreateSection(".eh_frame", false, SectionKind::getDataRel());
+  
+  // Debug Info Sections.
+  DwarfAbbrevSection = 
+    getOrCreateSection(".debug_abbrev", false, SectionKind::getMetadata());
+  DwarfInfoSection = 
+    getOrCreateSection(".debug_info", false, SectionKind::getMetadata());
+  DwarfLineSection = 
+    getOrCreateSection(".debug_line", false, SectionKind::getMetadata());
+  DwarfFrameSection = 
+    getOrCreateSection(".debug_frame", false, SectionKind::getMetadata());
+  DwarfPubNamesSection = 
+    getOrCreateSection(".debug_pubnames", false, SectionKind::getMetadata());
+  DwarfPubTypesSection = 
+    getOrCreateSection(".debug_pubtypes", false, SectionKind::getMetadata());
+  DwarfStrSection = 
+    getOrCreateSection(".debug_str", false, SectionKind::getMetadata());
+  DwarfLocSection = 
+    getOrCreateSection(".debug_loc", false, SectionKind::getMetadata());
+  DwarfARangesSection = 
+    getOrCreateSection(".debug_aranges", false, SectionKind::getMetadata());
+  DwarfRangesSection = 
+    getOrCreateSection(".debug_ranges", false, SectionKind::getMetadata());
+  DwarfMacroInfoSection = 
+    getOrCreateSection(".debug_macinfo", false, SectionKind::getMetadata());
 }
 
 
@@ -549,11 +587,52 @@
       getOrCreateSection(".mod_term_func", true, SectionKind::getDataRel());
   }
   
+  // Exception Handling.
   LSDASection = getOrCreateSection("__DATA,__gcc_except_tab", false,
                                    SectionKind::getDataRel());
   EHFrameSection =
     getOrCreateSection("__TEXT,__eh_frame,coalesced,no_toc+strip_static_syms"
                        "+live_support", false, SectionKind::getReadOnly());
+
+  // Debug Information.
+  // FIXME: Don't use 'directive' syntax: need flags for debug/regular??
+  // FIXME: Need __DWARF segment.
+  DwarfAbbrevSection = 
+    getOrCreateSection(".section __DWARF,__debug_abbrev,regular,debug", true,
+                       SectionKind::getMetadata());
+  DwarfInfoSection =  
+    getOrCreateSection(".section __DWARF,__debug_info,regular,debug", true,
+                       SectionKind::getMetadata());
+  DwarfLineSection =  
+    getOrCreateSection(".section __DWARF,__debug_line,regular,debug", true,
+                       SectionKind::getMetadata());
+  DwarfFrameSection =  
+    getOrCreateSection(".section __DWARF,__debug_frame,regular,debug", true,
+                       SectionKind::getMetadata());
+  DwarfPubNamesSection =  
+    getOrCreateSection(".section __DWARF,__debug_pubnames,regular,debug", true,
+                       SectionKind::getMetadata());
+  DwarfPubTypesSection =  
+    getOrCreateSection(".section __DWARF,__debug_pubtypes,regular,debug", true,
+                       SectionKind::getMetadata());
+  DwarfStrSection =  
+    getOrCreateSection(".section __DWARF,__debug_str,regular,debug", true,
+                       SectionKind::getMetadata());
+  DwarfLocSection =  
+    getOrCreateSection(".section __DWARF,__debug_loc,regular,debug", true,
+                       SectionKind::getMetadata());
+  DwarfARangesSection =  
+    getOrCreateSection(".section __DWARF,__debug_aranges,regular,debug", true,
+                       SectionKind::getMetadata());
+  DwarfRangesSection =  
+    getOrCreateSection(".section __DWARF,__debug_ranges,regular,debug", true,
+                       SectionKind::getMetadata());
+  DwarfMacroInfoSection =  
+    getOrCreateSection(".section __DWARF,__debug_macinfo,regular,debug", true,
+                       SectionKind::getMetadata());
+  DwarfDebugInlineSection = 
+    getOrCreateSection(".section __DWARF,__debug_inlined,regular,debug", true,
+                       SectionKind::getMetadata());
 }
 
 const MCSection *TargetLoweringObjectFileMachO::
@@ -665,6 +744,43 @@
     getOrCreateSection(".ctors", false, SectionKind::getDataRel());
   StaticDtorSection =
     getOrCreateSection(".dtors", false, SectionKind::getDataRel());
+  
+  
+  // Debug info.
+  // FIXME: Don't use 'directive' mode here.
+  DwarfAbbrevSection =  
+    getOrCreateSection("\t.section\t.debug_abbrev,\"dr\"",
+                       true, SectionKind::getMetadata());
+  DwarfInfoSection =    
+    getOrCreateSection("\t.section\t.debug_info,\"dr\"",
+                       true, SectionKind::getMetadata());
+  DwarfLineSection =    
+    getOrCreateSection("\t.section\t.debug_line,\"dr\"",
+                       true, SectionKind::getMetadata());
+  DwarfFrameSection =   
+    getOrCreateSection("\t.section\t.debug_frame,\"dr\"",
+                       true, SectionKind::getMetadata());
+  DwarfPubNamesSection =
+    getOrCreateSection("\t.section\t.debug_pubnames,\"dr\"",
+                       true, SectionKind::getMetadata());
+  DwarfPubTypesSection =
+    getOrCreateSection("\t.section\t.debug_pubtypes,\"dr\"",
+                       true, SectionKind::getMetadata());
+  DwarfStrSection =     
+    getOrCreateSection("\t.section\t.debug_str,\"dr\"",
+                       true, SectionKind::getMetadata());
+  DwarfLocSection =     
+    getOrCreateSection("\t.section\t.debug_loc,\"dr\"",
+                       true, SectionKind::getMetadata());
+  DwarfARangesSection = 
+    getOrCreateSection("\t.section\t.debug_aranges,\"dr\"",
+                       true, SectionKind::getMetadata());
+  DwarfRangesSection =  
+    getOrCreateSection("\t.section\t.debug_ranges,\"dr\"",
+                       true, SectionKind::getMetadata());
+  DwarfMacroInfoSection = 
+    getOrCreateSection("\t.section\t.debug_macinfo,\"dr\"",
+                       true, SectionKind::getMetadata());
 }
 
 void TargetLoweringObjectFileCOFF::
diff --git a/lib/Target/X86/X86TargetAsmInfo.cpp b/lib/Target/X86/X86TargetAsmInfo.cpp
index 24136ba..7611567 100644
--- a/lib/Target/X86/X86TargetAsmInfo.cpp
+++ b/lib/Target/X86/X86TargetAsmInfo.cpp
@@ -74,7 +74,6 @@
   ProtectedDirective = "\t.globl\t";
 
   SupportsDebugInformation = true;
-  DwarfDebugInlineSection = ".section __DWARF,__debug_inlined,regular,debug";
   DwarfUsesInlineInfoSection = true;
 
   // Exceptions handling
@@ -98,17 +97,6 @@
   // Debug Information
   AbsoluteDebugSectionOffsets = true;
   SupportsDebugInformation = true;
-  DwarfAbbrevSection =  "\t.section\t.debug_abbrev,\"\",@progbits";
-  DwarfInfoSection =    "\t.section\t.debug_info,\"\",@progbits";
-  DwarfLineSection =    "\t.section\t.debug_line,\"\",@progbits";
-  DwarfFrameSection =   "\t.section\t.debug_frame,\"\",@progbits";
-  DwarfPubNamesSection ="\t.section\t.debug_pubnames,\"\",@progbits";
-  DwarfPubTypesSection ="\t.section\t.debug_pubtypes,\"\",@progbits";
-  DwarfStrSection =     "\t.section\t.debug_str,\"\",@progbits";
-  DwarfLocSection =     "\t.section\t.debug_loc,\"\",@progbits";
-  DwarfARangesSection = "\t.section\t.debug_aranges,\"\",@progbits";
-  DwarfRangesSection =  "\t.section\t.debug_ranges,\"\",@progbits";
-  DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"\",@progbits";
 
   // Exceptions handling
   SupportsExceptionHandling = true;
diff --git a/lib/Target/XCore/XCoreTargetAsmInfo.cpp b/lib/Target/XCore/XCoreTargetAsmInfo.cpp
index a5bc6c2..eebd6c9 100644
--- a/lib/Target/XCore/XCoreTargetAsmInfo.cpp
+++ b/lib/Target/XCore/XCoreTargetAsmInfo.cpp
@@ -27,17 +27,5 @@
   // Debug
   HasLEB128 = true;
   AbsoluteDebugSectionOffsets = true;
-  
-  DwarfAbbrevSection = "\t.section\t.debug_abbrev,\"\",@progbits";
-  DwarfInfoSection = "\t.section\t.debug_info,\"\",@progbits";
-  DwarfLineSection = "\t.section\t.debug_line,\"\",@progbits";
-  DwarfFrameSection = "\t.section\t.debug_frame,\"\",@progbits";
-  DwarfPubNamesSection = "\t.section\t.debug_pubnames,\"\",@progbits";
-  DwarfPubTypesSection = "\t.section\t.debug_pubtypes,\"\",@progbits";
-  DwarfStrSection = "\t.section\t.debug_str,\"\",@progbits";
-  DwarfLocSection = "\t.section\t.debug_loc,\"\",@progbits";
-  DwarfARangesSection = "\t.section\t.debug_aranges,\"\",@progbits";
-  DwarfRangesSection = "\t.section\t.debug_ranges,\"\",@progbits";
-  DwarfMacroInfoSection = "\t.section\t.debug_macinfo,\"\",@progbits";
 }