diff options
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r-- | llvm/tools/llvm-objdump/llvm-objdump.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index 0316c4b..815759d 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -50,6 +50,7 @@ #include "llvm/Object/BuildID.h" #include "llvm/Object/COFF.h" #include "llvm/Object/COFFImportFile.h" +#include "llvm/Object/DXContainer.h" #include "llvm/Object/ELFObjectFile.h" #include "llvm/Object/ELFTypes.h" #include "llvm/Object/FaultMapParser.h" @@ -386,6 +387,8 @@ static Expected<std::unique_ptr<Dumper>> createDumper(const ObjectFile &Obj) { return createWasmDumper(*O); if (const auto *O = dyn_cast<XCOFFObjectFile>(&Obj)) return createXCOFFDumper(*O); + if (const auto *O = dyn_cast<DXContainerObjectFile>(&Obj)) + return createDXContainerDumper(*O); return createStringError(errc::invalid_argument, "unsupported object file format"); @@ -633,8 +636,14 @@ static bool isCSKYElf(const ObjectFile &Obj) { return Elf && Elf->getEMachine() == ELF::EM_CSKY; } +static bool isRISCVElf(const ObjectFile &Obj) { + const auto *Elf = dyn_cast<ELFObjectFileBase>(&Obj); + return Elf && Elf->getEMachine() == ELF::EM_RISCV; +} + static bool hasMappingSymbols(const ObjectFile &Obj) { - return isArmElf(Obj) || isAArch64Elf(Obj) || isCSKYElf(Obj); + return isArmElf(Obj) || isAArch64Elf(Obj) || isCSKYElf(Obj) || + isRISCVElf(Obj); } static void printRelocation(formatted_raw_ostream &OS, StringRef FileName, @@ -2736,7 +2745,7 @@ void Dumper::printRelocations() { for (const SectionRef &Section : ToolSectionFilter(O, &Ndx)) { if (O.isELF() && (ELFSectionRef(Section).getFlags() & ELF::SHF_ALLOC)) continue; - if (Section.relocation_begin() == Section.relocation_end()) + if (Section.relocations().empty()) continue; Expected<section_iterator> SecOrErr = Section.getRelocatedSection(); if (!SecOrErr) |