[Lldb-commits] [lldb] r115729 - /lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Greg Clayton gclayton at apple.com
Tue Oct 5 18:26:32 PDT 2010


Author: gclayton
Date: Tue Oct  5 20:26:32 2010
New Revision: 115729

URL: http://llvm.org/viewvc/llvm-project?rev=115729&view=rev
Log:
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.


Modified:
    lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp?rev=115729&r1=115728&r2=115729&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp Tue Oct  5 20:26:32 2010
@@ -277,8 +277,10 @@
                     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 @@
                                     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;





More information about the lldb-commits mailing list