X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;ds=sidebyside;f=tools%2Fllvm-readobj%2FELFDumper.cpp;h=d68c78682d23144288afac41c66055f70edf0f83;hb=5f3f254ed1d601c60d03e4437f75783774b03583;hp=502c7197ddb21cb55d6dd999ab9d2cc1ad5ce6ce;hpb=ef592db349f87eda79ac645602b5ec93929e20d8;p=oota-llvm.git diff --git a/tools/llvm-readobj/ELFDumper.cpp b/tools/llvm-readobj/ELFDumper.cpp index 502c7197ddb..d68c78682d2 100644 --- a/tools/llvm-readobj/ELFDumper.cpp +++ b/tools/llvm-readobj/ELFDumper.cpp @@ -407,6 +407,7 @@ static const char *getElfSectionType(unsigned Arch, unsigned Type) { switch (Type) { LLVM_READOBJ_ENUM_CASE(ELF, SHT_MIPS_REGINFO); LLVM_READOBJ_ENUM_CASE(ELF, SHT_MIPS_OPTIONS); + LLVM_READOBJ_ENUM_CASE(ELF, SHT_MIPS_ABIFLAGS); } } @@ -603,7 +604,7 @@ void ELFDumper::printSections() { } } - if (opts::SectionData) { + if (opts::SectionData && Section->sh_type != ELF::SHT_NOBITS) { ArrayRef Data = errorOrDefault(Obj->getSectionContents(Section)); W.printBinaryBlock("SectionData", StringRef((const char *)Data.data(), Data.size())); @@ -675,7 +676,8 @@ void ELFDumper::printRelocation(const Elf_Shdr *Sec, DictScope Group(W, "Relocation"); W.printHex("Offset", Rel.r_offset); W.printNumber("Type", RelocName, (int)Rel.getType(Obj->isMips64EL())); - W.printString("Symbol", SymbolName.size() > 0 ? SymbolName : "-"); + W.printNumber("Symbol", SymbolName.size() > 0 ? SymbolName : "-", + Rel.getSymbol(Obj->isMips64EL())); W.printHex("Addend", Rel.r_addend); } else { raw_ostream& OS = W.startLine(); @@ -1087,7 +1089,7 @@ void MipsGOTParser::parseGOT(const Elf_Shdr &GOTShdr) { Elf_Sym_Iter DynSymEnd = Obj->end_dynamic_symbols(); std::size_t DynSymTotal = std::size_t(std::distance(DynSymBegin, DynSymEnd)); - if (DtGotSym + 1 > DynSymTotal) { + if (DtGotSym > DynSymTotal) { W.startLine() << "MIPS_GOTSYM exceeds a number of dynamic symbols.\n"; return; }