diff options
author | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-08-30 18:52:02 +0000 |
---|---|---|
committer | Saleem Abdulrasool <compnerd@compnerd.org> | 2016-08-30 18:52:02 +0000 |
commit | 6a405448f396afda39e2ed9054c492f5943acd8f (patch) | |
tree | da439e5e305bf65c7c845c02e6828374e336011e /llvm/tools/llvm-readobj/llvm-readobj.cpp | |
parent | 2613d98f2a120b359497e59cdc405584b0115ce2 (diff) | |
download | bcm5719-llvm-6a405448f396afda39e2ed9054c492f5943acd8f.tar.gz bcm5719-llvm-6a405448f396afda39e2ed9054c492f5943acd8f.zip |
llvm-readobj: add support for printing GNU Notes
Add support for printing the GNU Notes. This allows an easy way to view the
build id for a binary built with the build id. Currently, this only handles the
GNU notes, though it would be easy to extend for other note types (default,
FreeBSD, NetBSD, etc). Only the GNU style is supported currently.
llvm-svn: 280131
Diffstat (limited to 'llvm/tools/llvm-readobj/llvm-readobj.cpp')
-rw-r--r-- | llvm/tools/llvm-readobj/llvm-readobj.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/tools/llvm-readobj/llvm-readobj.cpp b/llvm/tools/llvm-readobj/llvm-readobj.cpp index d811ea995ba..53d6782a671 100644 --- a/llvm/tools/llvm-readobj/llvm-readobj.cpp +++ b/llvm/tools/llvm-readobj/llvm-readobj.cpp @@ -92,6 +92,10 @@ namespace opts { cl::desc("Alias for --relocations"), cl::aliasopt(Relocations)); + // -notes, -n + cl::opt<bool> Notes("notes", cl::desc("Display the ELF notes in the file")); + cl::alias NotesShort("n", cl::desc("Alias for --notes"), cl::aliasopt(Notes)); + // -dyn-relocations cl::opt<bool> DynRelocs("dyn-relocations", cl::desc("Display the dynamic relocation entries in the file")); @@ -408,6 +412,8 @@ static void dumpObject(const ObjectFile *Obj) { Dumper->printGroupSections(); if (opts::HashHistogram) Dumper->printHashHistogram(); + if (opts::Notes) + Dumper->printNotes(); } if (Obj->isCOFF()) { if (opts::COFFImports) |