[llvm-readobj/ELF] Print GNU Hash section

Add a new command line switch, -gnu-hash-table, to print the content of that section.

Differential Revision: http://reviews.llvm.org/D13696

llvm-svn: 250291
This commit is contained in:
Igor Kudrin
2015-10-14 12:11:50 +00:00
parent dee8834570
commit 496fb2f040
11 changed files with 132 additions and 0 deletions

View File

@@ -132,6 +132,10 @@ namespace opts {
cl::opt<bool> HashTable("hash-table",
cl::desc("Display ELF hash table"));
// -gnu-hash-table
cl::opt<bool> GnuHashTable("gnu-hash-table",
cl::desc("Display ELF .gnu.hash section"));
// -expand-relocs
cl::opt<bool> ExpandRelocs("expand-relocs",
cl::desc("Expand each shown relocation to multiple lines"));
@@ -322,6 +326,8 @@ static void dumpObject(const ObjectFile *Obj) {
Dumper->printProgramHeaders();
if (opts::HashTable)
Dumper->printHashTable();
if (opts::GnuHashTable)
Dumper->printGnuHashTable();
if (Obj->getArch() == llvm::Triple::arm && Obj->isELF())
if (opts::ARMAttributes)
Dumper->printAttributes();