diff options
author | David Meyer <pdox@google.com> | 2012-03-01 22:19:54 +0000 |
---|---|---|
committer | David Meyer <pdox@google.com> | 2012-03-01 22:19:54 +0000 |
commit | 97f7787bfb56ad31fe20ec0bb9c3c9f3253d14fb (patch) | |
tree | 6a3c615a02060ec4f77b81f1ca36800c97f6b2d8 /tools/llvm-readobj/llvm-readobj.cpp | |
parent | b0578512c79134136e8b53c62a8677ab8e600be2 (diff) |
[Object]
Add ObjectFile::getLoadName() for retrieving the soname/installname of a shared object.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151845 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-readobj/llvm-readobj.cpp')
-rw-r--r-- | tools/llvm-readobj/llvm-readobj.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tools/llvm-readobj/llvm-readobj.cpp b/tools/llvm-readobj/llvm-readobj.cpp index 7b8683f134..215039f5be 100644 --- a/tools/llvm-readobj/llvm-readobj.cpp +++ b/tools/llvm-readobj/llvm-readobj.cpp @@ -14,6 +14,7 @@ #include <string.h> #include "llvm/Object/ObjectFile.h" #include "llvm/Analysis/Verifier.h" +#include "llvm/ADT/Triple.h" #include "llvm/Support/Format.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/PrettyStackTrace.h" @@ -155,6 +156,16 @@ void DumpLibrariesNeeded(const ObjectFile *obj) { outs() << " Total: " << count << "\n\n"; } +void DumpHeaders(const ObjectFile *obj) { + outs() << "File Format : " << obj->getFileFormatName() << "\n"; + outs() << "Arch : " + << Triple::getArchTypeName((llvm::Triple::ArchType)obj->getArch()) + << "\n"; + outs() << "Address Size: " << (8*obj->getBytesInAddress()) << " bits\n"; + outs() << "Load Name : " << obj->getLoadName() << "\n"; + outs() << "\n"; +} + int main(int argc, char** argv) { error_code ec; sys::PrintStackTraceOnErrorSignal(); @@ -180,6 +191,7 @@ int main(int argc, char** argv) { errs() << InputFilename << ": Object type not recognized\n"; } + DumpHeaders(obj); DumpSymbols(obj); DumpDynamicSymbols(obj); DumpLibrariesNeeded(obj); |