summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Atanasyan <simon@atanasyan.com>2017-12-02 13:06:35 +0000
committerSimon Atanasyan <simon@atanasyan.com>2017-12-02 13:06:35 +0000
commit0eba9bcf82b3f7b913738c2b52fc5483b916890c (patch)
tree7ae10b4100557c0e9ef6362ae0a5c9df718096fd /test
parent2a502f2ce17616a842e58e69e38431ee14c33f08 (diff)
[llvm-readobj] Print static MIPS GOT
If a linked binary file contains a dynamic section, the GOT layout defined by the dynamic section entries. In a statically linked file the GOT is just a series of entries. This change teaches `llvm-readobj` to print the GOT in that case. That provides a feature parity with GNU `readelf`. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@319616 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rwxr-xr-xtest/tools/llvm-readobj/Inputs/got-static.exe.mipsbin0 -> 1168 bytes
-rw-r--r--test/tools/llvm-readobj/mips-got.test39
2 files changed, 38 insertions, 1 deletions
diff --git a/test/tools/llvm-readobj/Inputs/got-static.exe.mips b/test/tools/llvm-readobj/Inputs/got-static.exe.mips
new file mode 100755
index 00000000000..a369e32bd88
--- /dev/null
+++ b/test/tools/llvm-readobj/Inputs/got-static.exe.mips
Binary files differ
diff --git a/test/tools/llvm-readobj/mips-got.test b/test/tools/llvm-readobj/mips-got.test
index 20215871ef0..65ccf13f2b4 100644
--- a/test/tools/llvm-readobj/mips-got.test
+++ b/test/tools/llvm-readobj/mips-got.test
@@ -8,8 +8,10 @@ RUN: llvm-readobj -mips-plt-got %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: FileCheck %s -check-prefix GOT-EMPTY
+RUN: llvm-readobj -mips-plt-got %p/Inputs/got-static.exe.mips | \
+RUN: FileCheck %s -check-prefix GOT-STATIC
-GOT-OBJ: Cannot find PLTGOT dynamic table tag.
+GOT-OBJ: Cannot find .got section
GOT-EXE: Primary GOT {
GOT-EXE-NEXT: Canonical gp value: 0x418880
@@ -329,3 +331,38 @@ GOT-EMPTY-NEXT: Global entries [
GOT-EMPTY-NEXT: ]
GOT-EMPTY-NEXT: Number of TLS and multi-GOT entries: 2
GOT-EMPTY-NEXT: }
+
+GOT-STATIC: Static GOT {
+GOT-STATIC-NEXT: Canonical gp value: 0x418100
+GOT-STATIC-NEXT: Reserved entries [
+GOT-STATIC-NEXT: Entry {
+GOT-STATIC-NEXT: Address: 0x410110
+GOT-STATIC-NEXT: Access: -32752
+GOT-STATIC-NEXT: Initial: 0x0
+GOT-STATIC-NEXT: Purpose: Lazy resolver
+GOT-STATIC-NEXT: }
+GOT-STATIC-NEXT: Entry {
+GOT-STATIC-NEXT: Address: 0x410114
+GOT-STATIC-NEXT: Access: -32748
+GOT-STATIC-NEXT: Initial: 0x80000000
+GOT-STATIC-NEXT: Purpose: Module pointer (GNU extension)
+GOT-STATIC-NEXT: }
+GOT-STATIC-NEXT: ]
+GOT-STATIC-NEXT: Local entries [
+GOT-STATIC-NEXT: Entry {
+GOT-STATIC-NEXT: Address: 0x410118
+GOT-STATIC-NEXT: Access: -32744
+GOT-STATIC-NEXT: Initial: 0x400000
+GOT-STATIC-NEXT: }
+GOT-STATIC-NEXT: Entry {
+GOT-STATIC-NEXT: Address: 0x41011C
+GOT-STATIC-NEXT: Access: -32740
+GOT-STATIC-NEXT: Initial: 0x400100
+GOT-STATIC-NEXT: }
+GOT-STATIC-NEXT: Entry {
+GOT-STATIC-NEXT: Address: 0x410120
+GOT-STATIC-NEXT: Access: -32736
+GOT-STATIC-NEXT: Initial: 0x400104
+GOT-STATIC-NEXT: }
+GOT-STATIC-NEXT: ]
+GOT-STATIC-NEXT: }