summaryrefslogtreecommitdiffstats
path: root/llvm/test
diff options
context:
space:
mode:
authorColin LeMahieu <colinl@codeaurora.org>2016-03-21 19:14:50 +0000
committerColin LeMahieu <colinl@codeaurora.org>2016-03-21 19:14:50 +0000
commitcdaf644c48d9f4deceb3afe6ee94a122fd3fc188 (patch)
tree6746be0cf91d11136f48b61566d36c3a5521fddd /llvm/test
parent8d83d6db7c1277eb50d5f654ed31874dbdbbca02 (diff)
downloadbcm5719-llvm-cdaf644c48d9f4deceb3afe6ee94a122fd3fc188.tar.gz
bcm5719-llvm-cdaf644c48d9f4deceb3afe6ee94a122fd3fc188.zip
[llvm-objdump] Printing relocations in executable and shared object files. This partially reverts r215844 by removing test objdump-reloc-shared.test which stated GNU objdump doesn't print relocations, it does.
In executable and shared object ELF files, relocations in the file contain the final virtual address rather than section offset so this is adjusted to display section offset. Differential revision: http://reviews.llvm.org/D15965 llvm-svn: 263971
Diffstat (limited to 'llvm/test')
-rw-r--r--llvm/test/Object/objdump-reloc-shared.test5
-rw-r--r--llvm/test/tools/llvm-objdump/X86/Inputs/relocations-in-nonrelocatable.elf-x86_64bin0 -> 9731 bytes
-rw-r--r--llvm/test/tools/llvm-objdump/X86/relocations-in-nonrelocatable.test9
3 files changed, 9 insertions, 5 deletions
diff --git a/llvm/test/Object/objdump-reloc-shared.test b/llvm/test/Object/objdump-reloc-shared.test
deleted file mode 100644
index d899ffb6087..00000000000
--- a/llvm/test/Object/objdump-reloc-shared.test
+++ /dev/null
@@ -1,5 +0,0 @@
-RUN: llvm-objdump -r %p/Inputs/elf-reloc-no-sym.x86_64 \
-RUN: | FileCheck %s
-
-; CHECK: elf-reloc-no-sym.x86_64: file format ELF64-x86-64
-; CHECK-NOT: {{.}}
diff --git a/llvm/test/tools/llvm-objdump/X86/Inputs/relocations-in-nonrelocatable.elf-x86_64 b/llvm/test/tools/llvm-objdump/X86/Inputs/relocations-in-nonrelocatable.elf-x86_64
new file mode 100644
index 00000000000..bb706c948cb
--- /dev/null
+++ b/llvm/test/tools/llvm-objdump/X86/Inputs/relocations-in-nonrelocatable.elf-x86_64
Binary files differ
diff --git a/llvm/test/tools/llvm-objdump/X86/relocations-in-nonrelocatable.test b/llvm/test/tools/llvm-objdump/X86/relocations-in-nonrelocatable.test
new file mode 100644
index 00000000000..4860b91dd6a
--- /dev/null
+++ b/llvm/test/tools/llvm-objdump/X86/relocations-in-nonrelocatable.test
@@ -0,0 +1,9 @@
+// This test checks that relocation in nonrelocatable files are printed
+// RUN: llvm-objdump -r %p/Inputs/relocations-in-nonrelocatable.elf-x86_64 | FileCheck %s
+
+// (main.c)
+// void g(void){}
+// int main(void) { g(); };
+// gcc main.c -o main -Wl,--emit-relocs
+
+CHECK: 00000000000000f8 R_X86_64_PC32 g-4-P \ No newline at end of file
OpenPOWER on IntegriCloud