[llvm-readobj][mips] Display MIPS specific info under --arch-specific flag
authorSimon Atanasyan <simon@atanasyan.com>
Thu, 3 Oct 2019 12:07:07 +0000 (12:07 +0000)
committerSimon Atanasyan <simon@atanasyan.com>
Thu, 3 Oct 2019 12:07:07 +0000 (12:07 +0000)
Old options `--mips-plt-got`, `--mips-abi-flags`, '--mips-reginfo`,
and `--mips-options` wiil be deleted in a separate patch.

llvm-svn: 373588

llvm/test/tools/llvm-readobj/mips-got-overlapped.test
llvm/test/tools/llvm-readobj/mips-got.test
llvm/test/tools/llvm-readobj/mips-options-sec.test
llvm/test/tools/llvm-readobj/mips-plt.test
llvm/test/tools/llvm-readobj/mips-reginfo.test
llvm/tools/llvm-readobj/llvm-readobj.cpp

index 85c4fe2..881c63b 100644 (file)
@@ -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.
 
index 6fc162a..8ed35d4 100644 (file)
@@ -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 {
index 64b3f0e..3636d56 100644 (file)
@@ -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 {
index b130a67..4e40ca6 100644 (file)
@@ -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 [
index 7571d4c..20177a9 100644 (file)
@@ -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
index 5919a7e..2e3041f 100644 (file)
@@ -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();