[lld] r229814 - PECOFF: use llvm-readobj to dump .reloc section
Rui Ueyama
ruiu at google.com
Wed Feb 18 20:02:18 PST 2015
Author: ruiu
Date: Wed Feb 18 22:02:17 2015
New Revision: 229814
URL: http://llvm.org/viewvc/llvm-project?rev=229814&view=rev
Log:
PECOFF: use llvm-readobj to dump .reloc section
When this test was written, no llvm tool could print out contents
of base relocation section. Now llvm-readobj is able to dump it in
a text format. Use that tool to make this test readable.
Modified:
lld/trunk/test/pecoff/base-reloc.test
Modified: lld/trunk/test/pecoff/base-reloc.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/pecoff/base-reloc.test?rev=229814&r1=229813&r2=229814&view=diff
==============================================================================
--- lld/trunk/test/pecoff/base-reloc.test (original)
+++ lld/trunk/test/pecoff/base-reloc.test Wed Feb 18 22:02:17 2015
@@ -2,22 +2,25 @@
#
# RUN: lld -flavor link /out:%t1.exe /subsystem:console /force /opt:noref \
# RUN: -- %t.obj
-# RUN: llvm-objdump -s %t1.exe | FileCheck %s --check-prefix=BASEREL-SECTION
+# RUN: llvm-readobj -coff-basereloc %t1.exe | FileCheck %s --check-prefix=BASEREL
#
# RUN: lld -flavor link /out:%t2.exe /subsystem:console /force /fixed \
# RUN: /opt:noref -- %t.obj
-# RUN: llvm-objdump -s %t2.exe | FileCheck %s --check-prefix=NOBASEREL-SECTION
+# RUN: llvm-readobj -coff-basereloc %t2.exe | FileCheck %s --check-prefix=NOBASEREL
-# Because llvm-objdump cannot pretty-print the contents of .reloc section, we
-# have no choice other than comparing the result with this binary blob.
-#
-# TODO: Improve llvm-objdump to pretty print .reloc section as GNU binutil
-# objdump does.
-
-BASEREL-SECTION: Contents of section .reloc:
-BASEREL-SECTION-NEXT: 3000 00200000 0c000000 07300c30
+BASEREL: BaseReloc [
+BASEREL-NEXT: Entry {
+BASEREL-NEXT: Type: HIGHLOW
+BASEREL-NEXT: Address: 0x2007
+BASEREL-NEXT: }
+BASEREL-NEXT: Entry {
+BASEREL-NEXT: Type: HIGHLOW
+BASEREL-NEXT: Address: 0x200C
+BASEREL-NEXT: }
+BASEREL-NEXT: ]
-NOBASEREL-SECTION-NOT: Contents of section .reloc:
+NOBASEREL: BaseReloc [
+NOBASEREL-NEXT: ]
# RUN: lld -flavor link /out:%t3.exe /subsystem:console /force /opt:noref \
# RUN: -- %t.obj
More information about the llvm-commits
mailing list