llmv-objdump/COFF: Print export table contents.

This patch adds the capability to dump export table contents. An example
output is this:

  Export Table:
   Ordinal      RVA  Name
         5   0x2008  exportfn1
         6   0x2010  exportfn2

By adding this feature to llvm-objdump, we will be able to use it to check
export table contents in LLD's tests. Currently we are doing binary
comparison in the tests, which is fragile and not readable to humans.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199358 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rui Ueyama
2014-01-16 07:05:49 +00:00
parent 9dcfdf61a8
commit fb432acff8
5 changed files with 168 additions and 10 deletions

Binary file not shown.

View File

@@ -1,9 +1,16 @@
// RUN: llvm-objdump -p %p/Inputs/nop.exe.coff-i386 | FileCheck %s
// RUN: llvm-objdump -p %p/Inputs/nop.exe.coff-i386 | \
// RUN: FileCheck -check-prefix=IMPORT %s
CHECK: The Import Tables:
CHECK-NEXT: lookup 00005028 time 00000000 fwd 00000000 name 00005096 addr 00005058
CHECK: DLL Name: KERNEL32.dll
CHECK-NEXT: Hint/Ord Name
CHECK-NEXT: 365 ExitProcess
IMPORT: The Import Tables:
IMPORT-NEXT: lookup 00005028 time 00000000 fwd 00000000 name 00005096 addr 00005058
IMPORT: DLL Name: KERNEL32.dll
IMPORT-NEXT: Hint/Ord Name
IMPORT-NEXT: 365 ExitProcess
// RUN: llvm-objdump -p %p/Inputs/export.dll.coff-i386 | \
// RUN: FileCheck -check-prefix=EXPORT %s
EXPORT: Export Table:
EXPORT-NEXT: Ordinal RVA Name
EXPORT-NEXT: 5 0x2008
EXPORT-NEXT: 6 0x2010 exportfn2