aboutsummaryrefslogtreecommitdiffstats
path: root/tools/llvm-objdump
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2013-09-27 01:29:36 +0000
committerRui Ueyama <ruiu@google.com>2013-09-27 01:29:36 +0000
commit4715a11dcfe79de2a7a8b0b633d6ca272eea0bc3 (patch)
treed0371e668bbe1d5d9a737c188076c3092721f69e /tools/llvm-objdump
parent10965f2045e28836b213a78d971f4e68d4d46c0e (diff)
downloadexternal_llvm-4715a11dcfe79de2a7a8b0b633d6ca272eea0bc3.zip
external_llvm-4715a11dcfe79de2a7a8b0b633d6ca272eea0bc3.tar.gz
external_llvm-4715a11dcfe79de2a7a8b0b633d6ca272eea0bc3.tar.bz2
Revert "llvm-objdump: Dump COFF import table if -private-headers option is given."
This reverts commit r191472 because it's failing on BE machine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191480 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-objdump')
-rw-r--r--tools/llvm-objdump/COFFDump.cpp46
-rw-r--r--tools/llvm-objdump/llvm-objdump.cpp12
-rw-r--r--tools/llvm-objdump/llvm-objdump.h3
3 files changed, 3 insertions, 58 deletions
diff --git a/tools/llvm-objdump/COFFDump.cpp b/tools/llvm-objdump/COFFDump.cpp
index 522d48d..bca6fc9 100644
--- a/tools/llvm-objdump/COFFDump.cpp
+++ b/tools/llvm-objdump/COFFDump.cpp
@@ -227,48 +227,6 @@ static void printCOFFSymbolAddress(llvm::raw_ostream &Out,
Out << format(" + 0x%04x", Disp);
}
-// Prints import tables. The import table is a table containing the list of
-// DLL name and symbol names which will be linked by the loader.
-static void printImportTables(const COFFObjectFile *Obj) {
- outs() << "The Import Tables:\n";
- error_code ec;
- for (import_directory_iterator i = Obj->getImportDirectoryBegin(),
- e = Obj->getImportDirectoryEnd();
- i != e; i = i.increment(ec)) {
- if (ec)
- return;
-
- const import_directory_table_entry *Dir;
- StringRef Name;
- if (i->getImportTableEntry(Dir)) return;
- if (i->getName(Name)) return;
-
- outs() << format(" lookup %08x time %08x fwd %08x name %08x addr %08x\n\n",
- static_cast<uint32_t>(Dir->ImportLookupTableRVA),
- static_cast<uint32_t>(Dir->TimeDateStamp),
- static_cast<uint32_t>(Dir->ForwarderChain),
- static_cast<uint32_t>(Dir->NameRVA),
- static_cast<uint32_t>(Dir->ImportAddressTableRVA));
- outs() << " DLL Name: " << Name << "\n";
- outs() << " Hint/Ord Name\n";
- const COFF::ImportLookupTableEntry32 *entry;
- if (i->getImportLookupEntry(entry))
- return;
- for (; entry->data; ++entry) {
- if (entry->isOrdinal()) {
- outs() << format(" % 6d\n", entry->getOrdinal());
- continue;
- }
- uint16_t Hint;
- StringRef Name;
- if (Obj->getHintName(entry->getHintNameRVA(), Hint, Name))
- return;
- outs() << format(" % 6d ", Hint) << Name << "\n";
- }
- outs() << "\n";
- }
-}
-
void llvm::printCOFFUnwindInfo(const COFFObjectFile *Obj) {
const coff_file_header *Header;
if (error(Obj->getCOFFHeader(Header))) return;
@@ -395,7 +353,3 @@ void llvm::printCOFFUnwindInfo(const COFFObjectFile *Obj) {
}
}
}
-
-void llvm::printCOFFFileHeader(const object::ObjectFile *Obj) {
- printImportTables(dyn_cast<const COFFObjectFile>(Obj));
-}
diff --git a/tools/llvm-objdump/llvm-objdump.cpp b/tools/llvm-objdump/llvm-objdump.cpp
index 9bc092e..8065787 100644
--- a/tools/llvm-objdump/llvm-objdump.cpp
+++ b/tools/llvm-objdump/llvm-objdump.cpp
@@ -770,14 +770,6 @@ 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()
@@ -795,8 +787,8 @@ static void DumpObject(const ObjectFile *o) {
PrintSymbolTable(o);
if (UnwindInfo)
PrintUnwindInfo(o);
- if (PrivateHeaders)
- printPrivateFileHeader(o);
+ if (PrivateHeaders && o->isELF())
+ printELFFileHeader(o);
}
/// @brief Dump each object file in \a a;
diff --git a/tools/llvm-objdump/llvm-objdump.h b/tools/llvm-objdump/llvm-objdump.h
index b716a26..87f19ba 100644
--- a/tools/llvm-objdump/llvm-objdump.h
+++ b/tools/llvm-objdump/llvm-objdump.h
@@ -34,8 +34,7 @@ void DumpBytes(StringRef bytes);
void DisassembleInputMachO(StringRef Filename);
void printCOFFUnwindInfo(const object::COFFObjectFile* o);
void printELFFileHeader(const object::ObjectFile *o);
-void printCOFFFileHeader(const object::ObjectFile *o);
-} // end namespace llvm
+}
#endif