From: Simon Atanasyan Date: Thu, 3 Oct 2019 12:07:07 +0000 (+0000) Subject: [llvm-readobj][mips] Display MIPS specific info under --arch-specific flag X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=65819da738997845049c90bb85b6e85ebe72b649;p=llvm [llvm-readobj][mips] Display MIPS specific info under --arch-specific flag Old options `--mips-plt-got`, `--mips-abi-flags`, '--mips-reginfo`, and `--mips-options` wiil be deleted in a separate patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373588 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/tools/llvm-readobj/mips-got-overlapped.test b/test/tools/llvm-readobj/mips-got-overlapped.test index 85c4fe2d67c..881c63b79a4 100644 --- a/test/tools/llvm-readobj/mips-got-overlapped.test +++ b/test/tools/llvm-readobj/mips-got-overlapped.test @@ -1,9 +1,9 @@ -# Check that llvm-readobj --mips-plt-got correctly shows .got section +# Check that llvm-readobj -A correctly shows .got section # content if there are some other zero-sized sections with the same # address as the .got. got-over.exe.elf-mips has zero-sized .data # section at the same offset .got section. -RUN: llvm-readobj --mips-plt-got %p/Inputs/got-over.exe.elf-mips | FileCheck %s +RUN: llvm-readobj -A %p/Inputs/got-over.exe.elf-mips | FileCheck %s GOT-OBJ: Cannot find PLTGOT dynamic table tag. diff --git a/test/tools/llvm-readobj/mips-got.test b/test/tools/llvm-readobj/mips-got.test index 6fc162ae5c6..8ed35d4b68e 100644 --- a/test/tools/llvm-readobj/mips-got.test +++ b/test/tools/llvm-readobj/mips-got.test @@ -1,23 +1,23 @@ -RUN: llvm-readobj --mips-plt-got %p/Inputs/dynamic-table-exe.mips | \ +RUN: llvm-readobj -A %p/Inputs/dynamic-table-exe.mips | \ RUN: FileCheck %s -check-prefix GOT-EXE -RUN: llvm-readobj --mips-plt-got %p/Inputs/dynamic-table-so.mips | \ +RUN: llvm-readobj -A %p/Inputs/dynamic-table-so.mips | \ RUN: FileCheck %s -check-prefix GOT-SO -RUN: llvm-readobj --mips-plt-got %p/Inputs/got-tls.so.elf-mips64el | \ +RUN: llvm-readobj -A %p/Inputs/got-tls.so.elf-mips64el | \ RUN: FileCheck %s -check-prefix GOT-TLS -RUN: llvm-readobj --mips-plt-got %p/Inputs/got-empty.exe.mipsel | \ +RUN: llvm-readobj -A %p/Inputs/got-empty.exe.mipsel | \ RUN: FileCheck %s -check-prefix GOT-EMPTY -RUN: llvm-readobj --mips-plt-got %p/Inputs/got-static.exe.mips | \ +RUN: llvm-readobj -A %p/Inputs/got-static.exe.mips | \ RUN: FileCheck %s -check-prefix GOT-STATIC -RUN: llvm-readelf --mips-plt-got %p/Inputs/dynamic-table-exe.mips | \ +RUN: llvm-readelf -A %p/Inputs/dynamic-table-exe.mips | \ RUN: FileCheck %s --strict-whitespace -check-prefix GNU-GOT-EXE -RUN: llvm-readelf --mips-plt-got %p/Inputs/dynamic-table-so.mips | \ +RUN: llvm-readelf -A %p/Inputs/dynamic-table-so.mips | \ RUN: FileCheck %s --strict-whitespace -check-prefix GNU-GOT-SO -RUN: llvm-readelf --mips-plt-got %p/Inputs/got-tls.so.elf-mips64el | \ +RUN: llvm-readelf -A %p/Inputs/got-tls.so.elf-mips64el | \ RUN: FileCheck %s --strict-whitespace -check-prefix GNU-GOT-TLS -RUN: llvm-readelf --mips-plt-got %p/Inputs/got-empty.exe.mipsel | \ +RUN: llvm-readelf -A %p/Inputs/got-empty.exe.mipsel | \ RUN: FileCheck %s --strict-whitespace -check-prefix GNU-GOT-EMPTY -RUN: llvm-readelf --mips-plt-got %p/Inputs/got-static.exe.mips | \ +RUN: llvm-readelf -A %p/Inputs/got-static.exe.mips | \ RUN: FileCheck %s --strict-whitespace -check-prefix GNU-GOT-STATIC GOT-EXE: Primary GOT { diff --git a/test/tools/llvm-readobj/mips-options-sec.test b/test/tools/llvm-readobj/mips-options-sec.test index 64b3f0e9179..3636d56cfe6 100644 --- a/test/tools/llvm-readobj/mips-options-sec.test +++ b/test/tools/llvm-readobj/mips-options-sec.test @@ -1,4 +1,4 @@ -RUN: llvm-readobj --mips-options %p/Inputs/options.obj.elf-mipsel | FileCheck %s +RUN: llvm-readobj -A %p/Inputs/options.obj.elf-mipsel | FileCheck %s CHECK: MIPS Options { CHECK-NEXT: ODK_REGINFO { diff --git a/test/tools/llvm-readobj/mips-plt.test b/test/tools/llvm-readobj/mips-plt.test index b130a67d044..4e40ca6aa2c 100644 --- a/test/tools/llvm-readobj/mips-plt.test +++ b/test/tools/llvm-readobj/mips-plt.test @@ -1,5 +1,5 @@ -RUN: llvm-readobj --mips-plt-got %p/Inputs/got-plt.exe.elf-mipsel | FileCheck %s -RUN: llvm-readelf --mips-plt-got %p/Inputs/got-plt.exe.elf-mipsel | FileCheck --check-prefix=GNU %s +RUN: llvm-readobj -A %p/Inputs/got-plt.exe.elf-mipsel | FileCheck %s +RUN: llvm-readelf -A %p/Inputs/got-plt.exe.elf-mipsel | FileCheck --check-prefix=GNU %s CHECK: PLT GOT { CHECK-NEXT: Reserved entries [ diff --git a/test/tools/llvm-readobj/mips-reginfo.test b/test/tools/llvm-readobj/mips-reginfo.test index 7571d4c56bf..20177a99d8c 100644 --- a/test/tools/llvm-readobj/mips-reginfo.test +++ b/test/tools/llvm-readobj/mips-reginfo.test @@ -1,4 +1,4 @@ -RUN: llvm-readobj --mips-reginfo %p/Inputs/reginfo.obj.elf-mipsel | FileCheck %s +RUN: llvm-readobj -A %p/Inputs/reginfo.obj.elf-mipsel | FileCheck %s CHECK: MIPS RegInfo { CHECK-NEXT: GP: 0x7FEF diff --git a/tools/llvm-readobj/llvm-readobj.cpp b/tools/llvm-readobj/llvm-readobj.cpp index 5919a7eed3e..2e3041fed18 100644 --- a/tools/llvm-readobj/llvm-readobj.cpp +++ b/tools/llvm-readobj/llvm-readobj.cpp @@ -519,9 +519,16 @@ static void dumpObject(const ObjectFile *Obj, ScopedPrinter &Writer, if (Obj->isELF()) { if (opts::ELFLinkerOptions) Dumper->printELFLinkerOptions(); - if (opts::ArchSpecificInfo) + if (opts::ArchSpecificInfo) { if (Obj->getArch() == llvm::Triple::arm) Dumper->printAttributes(); + else if (isMipsArch(Obj->getArch())) { + Dumper->printMipsABIFlags(); + Dumper->printMipsOptions(); + Dumper->printMipsReginfo(); + Dumper->printMipsPLTGOT(); + } + } if (isMipsArch(Obj->getArch())) { if (opts::MipsPLTGOT) Dumper->printMipsPLTGOT();