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
This commit is contained in:
Jim Grosbach
2014-03-18 22:09:05 +00:00
parent 802d81591a
commit d55fc3f151
15 changed files with 240 additions and 0 deletions

View File

@@ -213,6 +213,14 @@ void SwapStruct(MachO::linker_options_command &C) {
SwapValue(C.count);
}
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);
@@ -1467,6 +1475,11 @@ MachOObjectFile::getLinkerOptionsLoadCommand(const LoadCommandInfo &L) const {
return getStruct<MachO::linker_options_command>(this, L.Ptr);
}
MachO::version_min_command
MachOObjectFile::getVersionMinLoadCommand(const LoadCommandInfo &L) const {
return getStruct<MachO::version_min_command>(this, L.Ptr);
}
MachO::any_relocation_info
MachOObjectFile::getRelocation(DataRefImpl Rel) const {
const char *P = reinterpret_cast<const char *>(Rel.p);