summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Clayton <gclayton@apple.com>2011-08-26 20:01:35 +0000
committerGreg Clayton <gclayton@apple.com>2011-08-26 20:01:35 +0000
commit8f258513a18f62360160b1a03ce65b6bdfeb9c6b (patch)
tree0d6982078a9790cbb779d13d62eb3da1a5f9c737
parent79b2d3a4d48a513458105274d2ca719b9552740b (diff)
downloadbcm5719-llvm-8f258513a18f62360160b1a03ce65b6bdfeb9c6b.tar.gz
bcm5719-llvm-8f258513a18f62360160b1a03ce65b6bdfeb9c6b.zip
Fixed an assertion that could happen if we happened to parse a mach-o object
file that had a symbol that had a section specified where the section had zero size. We now honor this section definition for the symbol and don't assert anymore. llvm-svn: 138646
-rw-r--r--lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
index 083cb1f114b..4229cb7e091 100644
--- a/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ b/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -686,7 +686,18 @@ public:
}
}
if (m_section_infos[n_sect].vm_range.Contains(file_addr))
+ {
+ // Symbol is in section.
return m_section_infos[n_sect].section;
+ }
+ else if (m_section_infos[n_sect].vm_range.GetByteSize () == 0 &&
+ m_section_infos[n_sect].vm_range.GetBaseAddress() == file_addr)
+ {
+ // Symbol is in section with zero size, but has the same start
+ // address as the section. This can happen with linker symbols
+ // (symbols that start with the letter 'l' or 'L'.
+ return m_section_infos[n_sect].section;
+ }
}
return m_section_list->FindSectionContainingFileAddress(file_addr).get();
}
@@ -1162,7 +1173,13 @@ ObjectFileMachO::ParseSymtab (bool minimize)
case NListTypeSection: // N_SECT
symbol_section = section_info.GetSection (nlist.n_sect, nlist.n_value);
- assert(symbol_section != NULL);
+ if (symbol_section == NULL)
+ {
+ // TODO: warn about this?
+ add_nlist = false;
+ break;
+ }
+
if (TEXT_eh_frame_sectID == nlist.n_sect)
{
type = eSymbolTypeException;
OpenPOWER on IntegriCloud