Modify ObjectFileELF::GetArchitecture() to avoid calling ParseSectionHeaders() when we have headers.

Change by Matthew Gardiner.

llvm-svn: 212825
This commit is contained in:
Todd Fiala
2014-07-11 15:43:51 +00:00
parent 7c06819ecd
commit 09512ec2af

View File

@@ -2569,8 +2569,11 @@ ObjectFileELF::GetArchitecture (ArchSpec &arch)
if (!ParseHeader())
return false;
// Allow elf notes to be parsed which may affect the detected architecture.
ParseSectionHeaders();
if (m_section_headers.empty())
{
// Allow elf notes to be parsed which may affect the detected architecture.
ParseSectionHeaders();
}
arch = m_arch_spec;
return true;