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
This commit is contained in:
David Meyer
2012-03-01 22:19:54 +00:00
parent b0578512c7
commit 97f7787bfb
8 changed files with 77 additions and 1 deletions

View File

@@ -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);