From d55fc3f151f3167da4aa467cf2ff4038f82e3664 Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Tue, 18 Mar 2014 22:09:05 +0000 Subject: Darwin: Add assembler directives to create version-min load commands. Allow object files to be tagged with a version-min load command for iOS or MacOSX. Teach macho-dump to understand the version-min load commands for testcases. rdar://11337778 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204190 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/macho-dump/macho-dump.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tools/macho-dump') diff --git a/tools/macho-dump/macho-dump.cpp b/tools/macho-dump/macho-dump.cpp index beeef5b176..886487bfb4 100644 --- a/tools/macho-dump/macho-dump.cpp +++ b/tools/macho-dump/macho-dump.cpp @@ -319,6 +319,15 @@ DumpLinkerOptionsCommand(const MachOObjectFile &Obj, return 0; } +static int +DumpVersionMin(const MachOObjectFile &Obj, + const MachOObjectFile::LoadCommandInfo &LCI) { + MachO::version_min_command VMLC = Obj.getVersionMinLoadCommand(LCI); + outs() << " ('version, " << VMLC.version << ")\n" + << " ('reserved, " << VMLC.reserved << ")\n"; + return 0; +} + static int DumpLoadCommand(const MachOObjectFile &Obj, MachOObjectFile::LoadCommandInfo &LCI) { switch (LCI.C.cmd) { @@ -338,6 +347,9 @@ static int DumpLoadCommand(const MachOObjectFile &Obj, return DumpDataInCodeDataCommand(Obj, LCI); case MachO::LC_LINKER_OPTIONS: return DumpLinkerOptionsCommand(Obj, LCI); + case MachO::LC_VERSION_MIN_IPHONEOS: + case MachO::LC_VERSION_MIN_MACOSX: + return DumpVersionMin(Obj, LCI); default: Warning("unknown load command: " + Twine(LCI.C.cmd)); return 0; -- cgit v1.2.3