[llvm-readobj] Support 'GNU' style for MIPS GOT/PLT dumping

This change adds `printMipsGOT` and `printMipsPLT` methods to the
`DumpStyle` class and overrides them in the `GNUStyle` and `LLVMStyle`
descendants. To pass information about GOT/PLT layout into these
methods, the `MipsGOTParser` class has been extended to hold all
necessary data.

llvm-svn: 321253
diff --git a/llvm/test/tools/llvm-readobj/mips-plt.test b/llvm/test/tools/llvm-readobj/mips-plt.test
index ab0824b..f41940c 100644
--- a/llvm/test/tools/llvm-readobj/mips-plt.test
+++ b/llvm/test/tools/llvm-readobj/mips-plt.test
@@ -1,4 +1,7 @@
 RUN: llvm-readobj -mips-plt-got %p/Inputs/got-plt.exe.elf-mipsel | FileCheck %s
+RUN: llvm-readobj -mips-plt-got --elf-output-style=GNU \
+RUN:              %p/Inputs/got-plt.exe.elf-mipsel \
+RUN:   | FileCheck --check-prefix=GNU %s
 
 CHECK:      PLT GOT {
 CHECK-NEXT:   Reserved entries [
@@ -32,3 +35,32 @@
 CHECK-NEXT:     }
 CHECK-NEXT:   ]
 CHECK-NEXT: }
+
+GNU:      Primary GOT:
+GNU-NEXT:  Canonical gp value: 00418840
+
+GNU:       Reserved entries:
+GNU-NEXT:    Address     Access  Initial Purpose
+GNU-NEXT:   00410850 -32752(gp) 00000000 Lazy resolver
+GNU-NEXT:   00410854 -32748(gp) 80000000 Module pointer (GNU extension)
+
+GNU:       Local entries:
+GNU-NEXT:    Address     Access  Initial
+GNU-NEXT:   00410858 -32744(gp) 004003d4
+GNU-NEXT:   0041085c -32740(gp) 00410800
+GNU-NEXT:   00410860 -32736(gp) 00000000
+
+GNU:       Global entries:
+GNU-NEXT:    Address     Access  Initial Sym.Val. Type    Ndx Name
+GNU-NEXT:   00410864 -32732(gp) 00000000 00000000 FUNC    UND __gmon_start__
+GNU-NEXT: PLT GOT:
+
+GNU:       Reserved entries:
+GNU-NEXT:    Address  Initial Purpose
+GNU-NEXT:   00410814 00000000 PLT lazy resolver
+GNU-NEXT:   00410854 80000000 Module pointer
+
+GNU:       Entries:
+GNU-NEXT:    Address  Initial Sym.Val. Type    Ndx Name
+GNU-NEXT:   0041081c 004007c0 00000000 FUNC    UND puts
+GNU-NEXT:   00410820 004007c0 00000000 FUNC    UND __libc_start_main