Move alignment from MCSectionData to MCSection.
[oota-llvm.git] / lib / MC / MCObjectFileInfo.cpp
index 6370203b2fc325f822b2d9d69683be519cc168fe..e99f036af160a5628275d162d5cfdacbd4338810 100644 (file)
@@ -337,6 +337,7 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) {
     TTypeEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel |
       dwarf::DW_EH_PE_udata8;
     break;
+  case Triple::sparcel:
   case Triple::sparc:
     if (RelocM == Reloc::PIC_) {
       LSDAEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_sdata4;
@@ -459,8 +460,7 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) {
                                           "section_abbrev");
   DwarfInfoSection =
       Ctx->getELFSection(".debug_info", ELF::SHT_PROGBITS, 0, "section_info");
-  DwarfLineSection =
-      Ctx->getELFSection(".debug_line", ELF::SHT_PROGBITS, 0, "section_line");
+  DwarfLineSection = Ctx->getELFSection(".debug_line", ELF::SHT_PROGBITS, 0);
   DwarfFrameSection = Ctx->getELFSection(".debug_frame", ELF::SHT_PROGBITS, 0);
   DwarfPubNamesSection =
       Ctx->getELFSection(".debug_pubnames", ELF::SHT_PROGBITS, 0);
@@ -470,11 +470,10 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) {
       Ctx->getELFSection(".debug_gnu_pubnames", ELF::SHT_PROGBITS, 0);
   DwarfGnuPubTypesSection =
       Ctx->getELFSection(".debug_gnu_pubtypes", ELF::SHT_PROGBITS, 0);
-  DwarfStrSection = Ctx->getELFSection(".debug_str", ELF::SHT_PROGBITS,
-                                       ELF::SHF_MERGE | ELF::SHF_STRINGS, 1, "",
-                                       "info_string");
-  DwarfLocSection = Ctx->getELFSection(".debug_loc", ELF::SHT_PROGBITS, 0,
-                                       "section_debug_loc");
+  DwarfStrSection =
+      Ctx->getELFSection(".debug_str", ELF::SHT_PROGBITS,
+                         ELF::SHF_MERGE | ELF::SHF_STRINGS, 1, "");
+  DwarfLocSection = Ctx->getELFSection(".debug_loc", ELF::SHT_PROGBITS, 0);
   DwarfARangesSection =
       Ctx->getELFSection(".debug_aranges", ELF::SHT_PROGBITS, 0);
   DwarfRangesSection =
@@ -493,15 +492,15 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) {
       Ctx->getELFSection(".apple_types", ELF::SHT_PROGBITS, 0, "types_begin");
 
   // Fission Sections
-  DwarfInfoDWOSection = Ctx->getELFSection(".debug_info.dwo", ELF::SHT_PROGBITS,
-                                           0, "section_info_dwo");
-  DwarfTypesDWOSection = Ctx->getELFSection(
-      ".debug_types.dwo", ELF::SHT_PROGBITS, 0, "section_types_dwo");
-  DwarfAbbrevDWOSection = Ctx->getELFSection(
-      ".debug_abbrev.dwo", ELF::SHT_PROGBITS, 0, "section_abbrev_dwo");
-  DwarfStrDWOSection = Ctx->getELFSection(".debug_str.dwo", ELF::SHT_PROGBITS,
-                                          ELF::SHF_MERGE | ELF::SHF_STRINGS, 1,
-                                          "", "skel_string");
+  DwarfInfoDWOSection =
+      Ctx->getELFSection(".debug_info.dwo", ELF::SHT_PROGBITS, 0);
+  DwarfTypesDWOSection =
+      Ctx->getELFSection(".debug_types.dwo", ELF::SHT_PROGBITS, 0);
+  DwarfAbbrevDWOSection =
+      Ctx->getELFSection(".debug_abbrev.dwo", ELF::SHT_PROGBITS, 0);
+  DwarfStrDWOSection =
+      Ctx->getELFSection(".debug_str.dwo", ELF::SHT_PROGBITS,
+                         ELF::SHF_MERGE | ELF::SHF_STRINGS, 1, "");
   DwarfLineDWOSection =
       Ctx->getELFSection(".debug_line.dwo", ELF::SHT_PROGBITS, 0);
   DwarfLocDWOSection =
@@ -651,7 +650,7 @@ void MCObjectFileInfo::InitCOFFMCObjectFileInfo(Triple T) {
       ".debug_types.dwo",
       COFF::IMAGE_SCN_MEM_DISCARDABLE | COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
           COFF::IMAGE_SCN_MEM_READ,
-      SectionKind::getMetadata());
+      SectionKind::getMetadata(), "section_types_dwo");
   DwarfAbbrevDWOSection = Ctx->getCOFFSection(
       ".debug_abbrev.dwo",
       COFF::IMAGE_SCN_MEM_DISCARDABLE | COFF::IMAGE_SCN_CNT_INITIALIZED_DATA |
@@ -755,7 +754,7 @@ void MCObjectFileInfo::InitMCObjectFileInfo(StringRef T, Reloc::Model relocm,
        Arch == Triple::aarch64 ||
        Arch == Triple::ppc || Arch == Triple::ppc64 ||
        Arch == Triple::UnknownArch) &&
-      (TT.isOSDarwin() || TT.isOSBinFormatMachO())) {
+      TT.isOSBinFormatMachO()) {
     Env = IsMachO;
     InitMachOMCObjectFileInfo(TT);
   } else if ((Arch == Triple::x86 || Arch == Triple::x86_64 ||
@@ -769,7 +768,7 @@ void MCObjectFileInfo::InitMCObjectFileInfo(StringRef T, Reloc::Model relocm,
   }
 }
 
-const MCSection *MCObjectFileInfo::getDwarfTypesSection(uint64_t Hash) const {
+MCSection *MCObjectFileInfo::getDwarfTypesSection(uint64_t Hash) const {
   return Ctx->getELFSection(".debug_types", ELF::SHT_PROGBITS, ELF::SHF_GROUP,
                             0, utostr(Hash));
 }