From: Simon Atanasyan Date: Fri, 4 Oct 2019 11:59:23 +0000 (+0000) Subject: [llvm-readobj][mips] Inline `printMipsPLTGOT` method X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b9860d96d2b83dc701ddd01e2d635b8ee8c00e7c;p=llvm [llvm-readobj][mips] Inline `printMipsPLTGOT` method git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373733 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/tools/llvm-readobj/ELFDumper.cpp b/tools/llvm-readobj/ELFDumper.cpp index 1e21d70dc25..ed222cd9fd6 100644 --- a/tools/llvm-readobj/ELFDumper.cpp +++ b/tools/llvm-readobj/ELFDumper.cpp @@ -215,7 +215,6 @@ private: } void printAttributes(); - void printMipsPLTGOT(); void printMipsReginfo(); void printMipsOptions(); @@ -2220,12 +2219,19 @@ template void ELFDumper::printArchSpecificInfo() { case EM_ARM: printAttributes(); break; - case EM_MIPS: + case EM_MIPS: { ELFDumperStyle->printMipsABIFlags(ObjF); printMipsOptions(); printMipsReginfo(); - printMipsPLTGOT(); + + MipsGOTParser Parser(Obj, ObjF->getFileName(), dynamic_table(), + dynamic_symbols()); + if (Parser.hasGot()) + ELFDumperStyle->printMipsGOT(Parser); + if (Parser.hasPlt()) + ELFDumperStyle->printMipsPLT(Parser); break; + }; default: break; } @@ -2538,20 +2544,6 @@ MipsGOTParser::getPltSym(const Entry *E) const { } } -template void ELFDumper::printMipsPLTGOT() { - const ELFFile *Obj = ObjF->getELFFile(); - if (Obj->getHeader()->e_machine != EM_MIPS) - reportError(createError("MIPS PLT GOT is available for MIPS targets only"), - ObjF->getFileName()); - - MipsGOTParser Parser(Obj, ObjF->getFileName(), dynamic_table(), - dynamic_symbols()); - if (Parser.hasGot()) - ELFDumperStyle->printMipsGOT(Parser); - if (Parser.hasPlt()) - ELFDumperStyle->printMipsPLT(Parser); -} - static const EnumEntry ElfMipsISAExtType[] = { {"None", Mips::AFL_EXT_NONE}, {"Broadcom SB-1", Mips::AFL_EXT_SB1},