On an ELF system, ".debug_str" is mergeable and contains null terminated strings
authorNick Lewycky <nicholas@mxc.ca>
Wed, 26 Oct 2011 18:44:32 +0000 (18:44 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Wed, 26 Oct 2011 18:44:32 +0000 (18:44 +0000)
composed of one byte characters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143044 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCObjectFileInfo.cpp

index df8b99d2be6c549322e38f86ba1284ec32495653..397e9c3a62ac8d3a8c3fcb011c2ef9180fb521fe 100644 (file)
@@ -354,8 +354,9 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) {
     Ctx->getELFSection(".debug_pubtypes", ELF::SHT_PROGBITS, 0,
                        SectionKind::getMetadata());
   DwarfStrSection =
-    Ctx->getELFSection(".debug_str", ELF::SHT_PROGBITS, 0,
-                       SectionKind::getMetadata());
+    Ctx->getELFSection(".debug_str", ELF::SHT_PROGBITS,
+                       ELF::SHF_MERGE | ELF::SHF_STRINGS,
+                       SectionKind::getMergeable1ByteCString());
   DwarfLocSection =
     Ctx->getELFSection(".debug_loc", ELF::SHT_PROGBITS, 0,
                        SectionKind::getMetadata());