diff options
author | Greg Clayton <gclayton@apple.com> | 2012-11-16 21:36:10 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-11-16 21:36:10 +0000 |
commit | d97ec1c0ce07013113e6c93a1997cfab150a3348 (patch) | |
tree | 110e9cd5b2746efcd095640b3d4a15cc7582495d /lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | |
parent | 38d880ac017ac6e7ba0319f8ce30478b3331647a (diff) | |
download | bcm5719-llvm-d97ec1c0ce07013113e6c93a1997cfab150a3348.tar.gz bcm5719-llvm-d97ec1c0ce07013113e6c93a1997cfab150a3348.zip |
<rdar://problem/12238339>
Make sure architectures are obeyed for skinny mach files.
llvm-svn: 168205
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp')
-rw-r--r-- | lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index 92afb424f64..3e6cd1efbb8 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -562,6 +562,11 @@ ObjectFileMachO::ParseHeader () ArchSpec mach_arch(eArchTypeMachO, m_header.cputype, m_header.cpusubtype); + // Check if the module has a required architecture + const ArchSpec &module_arch = module_sp->GetArchitecture(); + if (module_arch.IsValid() && !module_arch.IsExactMatch(mach_arch)) + return false; + if (SetModulesArchitecture (mach_arch)) { const size_t header_and_lc_size = m_header.sizeofcmds + MachHeaderSizeFromMagic(m_header.magic); |