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
This commit is contained in:
Greg Clayton 2010-10-06 01:26:32 +00:00
parent 0198ce06fc
commit f4abd0db15
1 changed files with 6 additions and 2 deletions

View File

@ -277,8 +277,10 @@ ObjectFileMachO::ParseSections ()
struct section_64 sect64;
::bzero (&sect64, 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;