From 448334a738408b08b9472f7ec15cc331f108e7bf 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 llvm-svn: 204190 --- llvm/lib/Object/MachOObjectFile.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'llvm/lib/Object/MachOObjectFile.cpp') diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index 450693f..6b1dd87 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -214,6 +214,14 @@ void SwapStruct(MachO::linker_options_command &C) { } template<> +void SwapStruct(MachO::version_min_command&C) { + SwapValue(C.cmd); + SwapValue(C.cmdsize); + SwapValue(C.version); + SwapValue(C.reserved); +} + +template<> void SwapStruct(MachO::data_in_code_entry &C) { SwapValue(C.offset); SwapValue(C.length); @@ -1467,6 +1475,11 @@ MachOObjectFile::getLinkerOptionsLoadCommand(const LoadCommandInfo &L) const { return getStruct(this, L.Ptr); } +MachO::version_min_command +MachOObjectFile::getVersionMinLoadCommand(const LoadCommandInfo &L) const { + return getStruct(this, L.Ptr); +} + MachO::any_relocation_info MachOObjectFile::getRelocation(DataRefImpl Rel) const { const char *P = reinterpret_cast(Rel.p); -- cgit v1.1