[llvm] r373733 - [llvm-readobj][mips] Inline `printMipsPLTGOT` method
Simon Atanasyan via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 4 04:59:23 PDT 2019
Author: atanasyan
Date: Fri Oct 4 04:59:23 2019
New Revision: 373733
URL: http://llvm.org/viewvc/llvm-project?rev=373733&view=rev
Log:
[llvm-readobj][mips] Inline `printMipsPLTGOT` method
Modified:
llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
Modified: llvm/trunk/tools/llvm-readobj/ELFDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ELFDumper.cpp?rev=373733&r1=373732&r2=373733&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ELFDumper.cpp (original)
+++ llvm/trunk/tools/llvm-readobj/ELFDumper.cpp Fri Oct 4 04:59:23 2019
@@ -215,7 +215,6 @@ private:
}
void printAttributes();
- void printMipsPLTGOT();
void printMipsReginfo();
void printMipsOptions();
@@ -2220,12 +2219,19 @@ template <class ELFT> void ELFDumper<ELF
case EM_ARM:
printAttributes();
break;
- case EM_MIPS:
+ case EM_MIPS: {
ELFDumperStyle->printMipsABIFlags(ObjF);
printMipsOptions();
printMipsReginfo();
- printMipsPLTGOT();
+
+ MipsGOTParser<ELFT> 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<ELFT>::getPltSym(const Ent
}
}
-template <class ELFT> void ELFDumper<ELFT>::printMipsPLTGOT() {
- const ELFFile<ELFT> *Obj = ObjF->getELFFile();
- if (Obj->getHeader()->e_machine != EM_MIPS)
- reportError(createError("MIPS PLT GOT is available for MIPS targets only"),
- ObjF->getFileName());
-
- MipsGOTParser<ELFT> Parser(Obj, ObjF->getFileName(), dynamic_table(),
- dynamic_symbols());
- if (Parser.hasGot())
- ELFDumperStyle->printMipsGOT(Parser);
- if (Parser.hasPlt())
- ELFDumperStyle->printMipsPLT(Parser);
-}
-
static const EnumEntry<unsigned> ElfMipsISAExtType[] = {
{"None", Mips::AFL_EXT_NONE},
{"Broadcom SB-1", Mips::AFL_EXT_SB1},
More information about the llvm-commits
mailing list