diff options
author | Rui Ueyama <ruiu@google.com> | 2013-09-27 00:07:01 +0000 |
---|---|---|
committer | Rui Ueyama <ruiu@google.com> | 2013-09-27 00:07:01 +0000 |
commit | 5b1adbaad9a18084e4da2cac4216b828c179d40f (patch) | |
tree | 93482a3ba0934585195688873c42b672df810ca0 /llvm/tools/llvm-objdump/llvm-objdump.cpp | |
parent | 6ac40036f152242e1bfae177614c090e1995d824 (diff) | |
download | bcm5719-llvm-5b1adbaad9a18084e4da2cac4216b828c179d40f.tar.gz bcm5719-llvm-5b1adbaad9a18084e4da2cac4216b828c179d40f.zip |
llvm-objdump: Dump COFF import table if -private-headers option is given.
This is a patch to add capability to llvm-objdump to dump COFF Import Table
entries, so that we can write tests for LLD checking Import Table contents.
llvm-objdump did not print anything but just file name if the format is COFF
and -private-headers option is given. This is a patch adds capability for
dumping DLL Import Table, which is specific to the COFF format.
In this patch I defined a new iterator to iterate over import table entries.
Also added a few functions to COFFObjectFile.cpp to access fields of the entry.
Differential Revision: http://llvm-reviews.chandlerc.com/D1719
llvm-svn: 191472
Diffstat (limited to 'llvm/tools/llvm-objdump/llvm-objdump.cpp')
-rw-r--r-- | llvm/tools/llvm-objdump/llvm-objdump.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/llvm/tools/llvm-objdump/llvm-objdump.cpp b/llvm/tools/llvm-objdump/llvm-objdump.cpp index 8065787945f..9bc092e1881 100644 --- a/llvm/tools/llvm-objdump/llvm-objdump.cpp +++ b/llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -770,6 +770,14 @@ static void PrintUnwindInfo(const ObjectFile *o) { } } +static void printPrivateFileHeader(const ObjectFile *o) { + if (o->isELF()) { + printELFFileHeader(o); + } else if (o->isCOFF()) { + printCOFFFileHeader(o); + } +} + static void DumpObject(const ObjectFile *o) { outs() << '\n'; outs() << o->getFileName() @@ -787,8 +795,8 @@ static void DumpObject(const ObjectFile *o) { PrintSymbolTable(o); if (UnwindInfo) PrintUnwindInfo(o); - if (PrivateHeaders && o->isELF()) - printELFFileHeader(o); + if (PrivateHeaders) + printPrivateFileHeader(o); } /// @brief Dump each object file in \a a; |