MC: Add a .debug section that we'll soon use to emit debug info into COFF files
authorTimur Iskhodzhanov <timurrrr@google.com>
Tue, 28 Jan 2014 03:48:44 +0000 (03:48 +0000)
committerTimur Iskhodzhanov <timurrrr@google.com>
Tue, 28 Jan 2014 03:48:44 +0000 (03:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200285 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/MC/MCObjectFileInfo.h
lib/MC/MCObjectFileInfo.cpp

index 7734a157f54f0461a4332512774c579fa00c8fcb..cc5eb9eeeb92b3913dc0496c4ff61aee07991c71 100644 (file)
@@ -129,6 +129,8 @@ protected:
   const MCSection *DwarfGnuPubNamesSection;
   const MCSection *DwarfGnuPubTypesSection;
 
+  const MCSection *COFFDebugSymbolsSection;
+
   // Extra TLS Variable Data section.  If the target needs to put additional
   // information for a TLS variable, it'll go here.
   const MCSection *TLSExtraDataSection;
@@ -283,6 +285,10 @@ public:
     return DwarfAddrSection;
   }
 
+  const MCSection *getCOFFDebugSymbolsSection() const {
+    return COFFDebugSymbolsSection;
+  }
+
   const MCSection *getTLSExtraDataSection() const {
     return TLSExtraDataSection;
   }
index 702ec6e421d0ac6990460fdc41fa6f823f843235..796d03bfeb3c138acaaf99c07fa0d7cd4e4b1cd2 100644 (file)
@@ -609,6 +609,13 @@ void MCObjectFileInfo::InitCOFFMCObjectFileInfo(Triple T) {
                         SectionKind::getReadOnly());
 
   // Debug info.
+  COFFDebugSymbolsSection =
+    Ctx->getCOFFSection(".debug$S",
+                        COFF::IMAGE_SCN_MEM_DISCARDABLE |
+                        COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
+                        COFF::IMAGE_SCN_MEM_READ,
+                        SectionKind::getMetadata());
+
   DwarfAbbrevSection =
     Ctx->getCOFFSection(".debug_abbrev",
                         COFF::IMAGE_SCN_MEM_DISCARDABLE |