From f4abd0db15db8e0f22c645a680fc2a77a75a1ba9 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Wed, 6 Oct 2010 01:26:32 +0000 Subject: [PATCH] Fixed an issue with the mach-o file parser when parsing indirect symbol stubs where the symbol index was set to INDIRECT_SYMBOL_ABS and was causing an assertion to fire when we loaded older Mac OS X binaries. llvm-svn: 115729 --- lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp index f1c7a1821800..ccb9105174f9 100644 --- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp +++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp @@ -277,8 +277,10 @@ ObjectFileMachO::ParseSections () struct section_64 sect64; ::bzero (§64, sizeof(sect64)); // Push a section into our mach sections for the section at - // index zero (NListSectionNoSection) - m_mach_sections.push_back(sect64); + // index zero (NListSectionNoSection) if we don't have any + // mach sections yet... + if (m_mach_sections.empty()) + m_mach_sections.push_back(sect64); uint32_t segment_sect_idx; const lldb::user_id_t first_segment_sectID = sectID + 1; @@ -1254,6 +1256,8 @@ ObjectFileMachO::ParseSymtab (bool minimize) if (indirect_symbol_index_data.ValidOffsetForDataOfSize(symbol_stub_offset, 4)) { const uint32_t stub_sym_id = indirect_symbol_index_data.GetU32 (&symbol_stub_offset); + if (stub_sym_id & (IndirectSymbolAbsolute | IndirectSymbolLocal)) + continue; NListIndexToSymbolIndexMap::const_iterator index_pos = m_nlist_idx_to_sym_idx.find (stub_sym_id); Symbol *stub_symbol = NULL;