From 3e6490f1e8290c2f1744a923badaa2f362c55d07 Mon Sep 17 00:00:00 2001 From: Rui Ueyama Date: Thu, 19 Feb 2015 04:02:17 +0000 Subject: [PATCH] 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. llvm-svn: 229814 --- lld/test/pecoff/base-reloc.test | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/lld/test/pecoff/base-reloc.test b/lld/test/pecoff/base-reloc.test index 8b2246f..1d1fde7 100644 --- a/lld/test/pecoff/base-reloc.test +++ b/lld/test/pecoff/base-reloc.test @@ -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 -- 2.7.4