diff options
Diffstat (limited to 'contrib/llvm/lib/MC/MCObjectFileInfo.cpp')
-rw-r--r-- | contrib/llvm/lib/MC/MCObjectFileInfo.cpp | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/contrib/llvm/lib/MC/MCObjectFileInfo.cpp b/contrib/llvm/lib/MC/MCObjectFileInfo.cpp index 96b62f1..8ef4a0a 100644 --- a/contrib/llvm/lib/MC/MCObjectFileInfo.cpp +++ b/contrib/llvm/lib/MC/MCObjectFileInfo.cpp @@ -39,6 +39,9 @@ void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) { = Ctx->getMachOSection("__DATA", "__data", 0, SectionKind::getDataRel()); + // BSSSection might not be expected initialized on msvc. + BSSSection = 0; + TLSDataSection // .tdata = Ctx->getMachOSection("__DATA", "__thread_data", MCSectionMachO::S_THREAD_LOCAL_REGULAR, @@ -79,7 +82,8 @@ void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) { // to using it in -static mode. SixteenByteConstantSection = 0; if (RelocM != Reloc::Static && - T.getArch() != Triple::x86_64 && T.getArch() != Triple::ppc64) + T.getArch() != Triple::x86_64 && T.getArch() != Triple::ppc64 && + T.getArch() != Triple::ppc64le) SixteenByteConstantSection = // .literal16 Ctx->getMachOSection("__TEXT", "__literal16", MCSectionMachO::S_16BYTE_LITERALS, @@ -198,6 +202,14 @@ void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) { Ctx->getMachOSection("__DWARF", "__debug_pubtypes", MCSectionMachO::S_ATTR_DEBUG, SectionKind::getMetadata()); + DwarfGnuPubNamesSection = + Ctx->getMachOSection("__DWARF", "__debug_gnu_pubn", + MCSectionMachO::S_ATTR_DEBUG, + SectionKind::getMetadata()); + DwarfGnuPubTypesSection = + Ctx->getMachOSection("__DWARF", "__debug_gnu_pubt", + MCSectionMachO::S_ATTR_DEBUG, + SectionKind::getMetadata()); DwarfStrSection = Ctx->getMachOSection("__DWARF", "__debug_str", MCSectionMachO::S_ATTR_DEBUG, @@ -222,6 +234,9 @@ void MCObjectFileInfo::InitMachOMCObjectFileInfo(Triple T) { Ctx->getMachOSection("__DWARF", "__debug_inlined", MCSectionMachO::S_ATTR_DEBUG, SectionKind::getMetadata()); + StackMapSection = + Ctx->getMachOSection("__LLVM_STACKMAPS", "__llvm_stackmaps", 0, + SectionKind::getMetadata()); TLSExtraDataSection = TLSTLVSection; } @@ -288,7 +303,7 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) { FDEEncoding = dwarf::DW_EH_PE_udata4; TTypeEncoding = dwarf::DW_EH_PE_absptr; } - } else if (T.getArch() == Triple::ppc64) { + } else if (T.getArch() == Triple::ppc64 || T.getArch() == Triple::ppc64le) { PersonalityEncoding = dwarf::DW_EH_PE_indirect | dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_udata8; LSDAEncoding = dwarf::DW_EH_PE_pcrel | dwarf::DW_EH_PE_udata8; @@ -434,6 +449,12 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) { DwarfPubTypesSection = Ctx->getELFSection(".debug_pubtypes", ELF::SHT_PROGBITS, 0, SectionKind::getMetadata()); + DwarfGnuPubNamesSection = + Ctx->getELFSection(".debug_gnu_pubnames", ELF::SHT_PROGBITS, 0, + SectionKind::getMetadata()); + DwarfGnuPubTypesSection = + Ctx->getELFSection(".debug_gnu_pubtypes", ELF::SHT_PROGBITS, 0, + SectionKind::getMetadata()); DwarfStrSection = Ctx->getELFSection(".debug_str", ELF::SHT_PROGBITS, ELF::SHF_MERGE | ELF::SHF_STRINGS, @@ -495,6 +516,12 @@ void MCObjectFileInfo::InitELFMCObjectFileInfo(Triple T) { void MCObjectFileInfo::InitCOFFMCObjectFileInfo(Triple T) { // COFF + BSSSection = + Ctx->getCOFFSection(".bss", + COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA | + COFF::IMAGE_SCN_MEM_READ | + COFF::IMAGE_SCN_MEM_WRITE, + SectionKind::getBSS()); TextSection = Ctx->getCOFFSection(".text", COFF::IMAGE_SCN_CNT_CODE | @@ -584,6 +611,16 @@ void MCObjectFileInfo::InitCOFFMCObjectFileInfo(Triple T) { COFF::IMAGE_SCN_MEM_DISCARDABLE | COFF::IMAGE_SCN_MEM_READ, SectionKind::getMetadata()); + DwarfGnuPubNamesSection = + Ctx->getCOFFSection(".debug_gnu_pubnames", + COFF::IMAGE_SCN_MEM_DISCARDABLE | + COFF::IMAGE_SCN_MEM_READ, + SectionKind::getMetadata()); + DwarfGnuPubTypesSection = + Ctx->getCOFFSection(".debug_gnu_pubtypes", + COFF::IMAGE_SCN_MEM_DISCARDABLE | + COFF::IMAGE_SCN_MEM_READ, + SectionKind::getMetadata()); DwarfStrSection = Ctx->getCOFFSection(".debug_str", COFF::IMAGE_SCN_MEM_DISCARDABLE | |