aboutsummaryrefslogtreecommitdiffstats
path: root/tools/macho-dump
diff options
context:
space:
mode:
authorStephen Hines <srhines@google.com>2014-07-21 00:45:20 -0700
committerStephen Hines <srhines@google.com>2014-07-21 00:45:20 -0700
commitc6a4f5e819217e1e12c458aed8e7b122e23a3a58 (patch)
tree81b7dd2bb4370a392f31d332a566c903b5744764 /tools/macho-dump
parent19c6fbb3e8aaf74093afa08013134b61fa08f245 (diff)
downloadexternal_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.zip
external_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.tar.gz
external_llvm-c6a4f5e819217e1e12c458aed8e7b122e23a3a58.tar.bz2
Update LLVM for rebase to r212749.
Includes a cherry-pick of: r212948 - fixes a small issue with atomic calls Change-Id: Ib97bd980b59f18142a69506400911a6009d9df18
Diffstat (limited to 'tools/macho-dump')
-rw-r--r--tools/macho-dump/Android.mk2
-rw-r--r--tools/macho-dump/macho-dump.cpp17
2 files changed, 17 insertions, 2 deletions
diff --git a/tools/macho-dump/Android.mk b/tools/macho-dump/Android.mk
index 9699d4a..001f293 100644
--- a/tools/macho-dump/Android.mk
+++ b/tools/macho-dump/Android.mk
@@ -12,6 +12,8 @@ macho_dump_SRC_FILES := \
macho_dump_STATIC_LIBRARIES := \
libLLVMObject \
+ libLLVMMC \
+ libLLVMMCParser \
libLLVMBitReader \
libLLVMCore \
libLLVMSupport \
diff --git a/tools/macho-dump/macho-dump.cpp b/tools/macho-dump/macho-dump.cpp
index 886487b..7600979 100644
--- a/tools/macho-dump/macho-dump.cpp
+++ b/tools/macho-dump/macho-dump.cpp
@@ -20,7 +20,7 @@
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/raw_ostream.h"
-#include "llvm/Support/system_error.h"
+#include <system_error>
using namespace llvm;
using namespace llvm::object;
@@ -328,6 +328,17 @@ DumpVersionMin(const MachOObjectFile &Obj,
return 0;
}
+static int
+DumpDylibID(const MachOObjectFile &Obj,
+ const MachOObjectFile::LoadCommandInfo &LCI) {
+ MachO::dylib_command DLLC = Obj.getDylibIDLoadCommand(LCI);
+ outs() << " ('install_name', '" << LCI.Ptr + DLLC.dylib.name << "')\n"
+ << " ('timestamp, " << DLLC.dylib.timestamp << ")\n"
+ << " ('cur_version, " << DLLC.dylib.current_version << ")\n"
+ << " ('compat_version, " << DLLC.dylib.compatibility_version << ")\n";
+ return 0;
+}
+
static int DumpLoadCommand(const MachOObjectFile &Obj,
MachOObjectFile::LoadCommandInfo &LCI) {
switch (LCI.C.cmd) {
@@ -350,6 +361,8 @@ static int DumpLoadCommand(const MachOObjectFile &Obj,
case MachO::LC_VERSION_MIN_IPHONEOS:
case MachO::LC_VERSION_MIN_MACOSX:
return DumpVersionMin(Obj, LCI);
+ case MachO::LC_ID_DYLIB:
+ return DumpDylibID(Obj, LCI);
default:
Warning("unknown load command: " + Twine(LCI.C.cmd));
return 0;
@@ -391,7 +404,7 @@ int main(int argc, char **argv) {
cl::ParseCommandLineOptions(argc, argv, "llvm Mach-O dumping tool\n");
ErrorOr<Binary *> BinaryOrErr = createBinary(InputFile);
- if (error_code EC = BinaryOrErr.getError())
+ if (std::error_code EC = BinaryOrErr.getError())
return Error("unable to read input: '" + EC.message() + "'");
std::unique_ptr<Binary> Binary(BinaryOrErr.get());