summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2014-07-11 15:13:33 +0000
committerTodd Fiala <todd.fiala@gmail.com>2014-07-11 15:13:33 +0000
commit6477ea87b7b1dd9076707c518604086f5af96991 (patch)
treeb9d4ca3724b28cd22025fe08e143723ba1666f3a /lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
parentad4c06c656d124366325116124bd278522dd12ce (diff)
downloadbcm5719-llvm-6477ea87b7b1dd9076707c518604086f5af96991.tar.gz
bcm5719-llvm-6477ea87b7b1dd9076707c518604086f5af96991.zip
Prevent ObjectFileELF::GetSectionHeaderInfo() from reparsing section headers.
If we have any section headers in the collection, we already parsed them. Therefore, don't reparse the section headers when the section_headers collection is not empty. See this thread for more details: http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140707/011721.html Change by Matthew Gardiner llvm-svn: 212822
Diffstat (limited to 'lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp')
-rw-r--r--lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
index e821f2ba74a..1aaad6a40ce 100644
--- a/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
+++ b/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
@@ -1242,6 +1242,10 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl &section_headers,
uint32_t &gnu_debuglink_crc,
ArchSpec &arch_spec)
{
+ // Don't reparse the section headers if we already did that.
+ if (!section_headers.empty())
+ return section_headers.size();
+
// Only initialize the arch_spec to okay defaults if they're not already set.
// We'll refine this with note data as we parse the notes.
if (arch_spec.GetTriple ().getOS () == llvm::Triple::OSType::UnknownOS)
@@ -1251,10 +1255,6 @@ ObjectFileELF::GetSectionHeaderInfo(SectionHeaderColl &section_headers,
arch_spec.GetTriple().setVendorName(Host::GetVendorString().GetCString());
}
- // We have already parsed the section headers
- if (!section_headers.empty())
- return section_headers.size();
-
// If there are no section headers we are done.
if (header.e_shnum == 0)
return 0;
OpenPOWER on IntegriCloud