diff --git a/llvm/include/llvm/Object/Binary.h b/llvm/include/llvm/Object/Binary.h --- a/llvm/include/llvm/Object/Binary.h +++ b/llvm/include/llvm/Object/Binary.h @@ -147,7 +147,8 @@ bool isLittleEndian() const { return !(TypeID == ID_ELF32B || TypeID == ID_ELF64B || - TypeID == ID_MachO32B || TypeID == ID_MachO64B); + TypeID == ID_MachO32B || TypeID == ID_MachO64B || + TypeID == ID_XCOFF32 || TypeID == ID_XCOFF64); } bool isWinRes() const { return TypeID == ID_WinRes; } diff --git a/llvm/include/llvm/Object/XCOFFObjectFile.h b/llvm/include/llvm/Object/XCOFFObjectFile.h --- a/llvm/include/llvm/Object/XCOFFObjectFile.h +++ b/llvm/include/llvm/Object/XCOFFObjectFile.h @@ -317,6 +317,7 @@ Triple::ArchType getArch() const override; SubtargetFeatures getFeatures() const override; Expected getStartAddress() const override; + StringRef mapDebugSectionName(StringRef Name) const override; bool isRelocatableObject() const override; // Below here is the non-inherited interface. diff --git a/llvm/lib/Object/XCOFFObjectFile.cpp b/llvm/lib/Object/XCOFFObjectFile.cpp --- a/llvm/lib/Object/XCOFFObjectFile.cpp +++ b/llvm/lib/Object/XCOFFObjectFile.cpp @@ -11,6 +11,7 @@ //===----------------------------------------------------------------------===// #include "llvm/Object/XCOFFObjectFile.h" +#include "llvm/ADT/StringSwitch.h" #include "llvm/MC/SubtargetFeature.h" #include "llvm/Support/DataExtractor.h" #include @@ -296,9 +297,7 @@ } bool XCOFFObjectFile::isSectionCompressed(DataRefImpl Sec) const { - bool Result = false; - llvm_unreachable("Not yet implemented!"); - return Result; + return false; } bool XCOFFObjectFile::isSectionText(DataRefImpl Sec) const { @@ -458,6 +457,22 @@ return 0; } +StringRef XCOFFObjectFile::mapDebugSectionName(StringRef Name) const { + return StringSwitch(Name) + .Case("dwinfo", "debug_info") + .Case("dwline", "debug_line") + .Case("dwpbnms", "debug_pubnames") + .Case("dwpbtyp", "debug_pubtypes") + .Case("dwarnge", "debug_aranges") + .Case("dwabrev", "debug_abbrev") + .Case("dwstr", "debug_str") + .Case("dwrnges", "debug_ranges") + .Case("dwloc", "debug_loc") + .Case("dwframe", "debug_frame") + .Case("dwmac", "debug_macinfo") + .Default(Name); +} + size_t XCOFFObjectFile::getFileHeaderSize() const { return is64Bit() ? sizeof(XCOFFFileHeader64) : sizeof(XCOFFFileHeader32); }