mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 04:24:00 +00:00
[llvm-readobj][ELF] New -mips-plt-got
command line option to output
MIPS GOT section. Patch reviewed by Rafael Espindola. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@211150 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -135,6 +135,11 @@ namespace opts {
|
||||
cl::desc("Display the ARM attributes section"));
|
||||
cl::alias ARMAttributesShort("-a", cl::desc("Alias for --arm-attributes"),
|
||||
cl::aliasopt(ARMAttributes));
|
||||
|
||||
// -mips-plt-got
|
||||
cl::opt<bool>
|
||||
MipsPLTGOT("mips-plt-got",
|
||||
cl::desc("Display the MIPS GOT and PLT GOT sections"));
|
||||
} // namespace opts
|
||||
|
||||
static int ReturnValue = EXIT_SUCCESS;
|
||||
@ -177,6 +182,18 @@ static void reportError(StringRef Input, StringRef Message) {
|
||||
ReturnValue = EXIT_FAILURE;
|
||||
}
|
||||
|
||||
static bool isMipsArch(unsigned Arch) {
|
||||
switch (Arch) {
|
||||
case llvm::Triple::mips:
|
||||
case llvm::Triple::mipsel:
|
||||
case llvm::Triple::mips64:
|
||||
case llvm::Triple::mips64el:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// @brief Creates an format-specific object file dumper.
|
||||
static std::error_code createDumper(const ObjectFile *Obj, StreamWriter &Writer,
|
||||
std::unique_ptr<ObjDumper> &Result) {
|
||||
@ -234,6 +251,9 @@ static void dumpObject(const ObjectFile *Obj) {
|
||||
if (Obj->getArch() == llvm::Triple::arm && Obj->isELF())
|
||||
if (opts::ARMAttributes)
|
||||
Dumper->printAttributes();
|
||||
if (isMipsArch(Obj->getArch()) && Obj->isELF())
|
||||
if (opts::MipsPLTGOT)
|
||||
Dumper->printMipsPLTGOT();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user