[ELF2] Only call getPPC64SectionRank for EM_PPC64 files

Suggested by Rafael in his review of r250100. As Rafael points out, this may
grow into a switch in the future, but regardless, calling this on files for
other architectures is unnecessary.

llvm-svn: 250209
This commit is contained in:
Hal Finkel 2015-10-13 19:07:29 +00:00
parent deac4909c7
commit 9abc2a50b3
1 changed files with 7 additions and 1 deletions

View File

@ -331,7 +331,13 @@ static bool compareOutputSections(OutputSectionBase<ELFT::Is64Bits> *A,
A->getType() != B->getType())
return A->getType() != SHT_NOBITS && B->getType() == SHT_NOBITS;
return getPPC64SectionRank(A->getName()) < getPPC64SectionRank(B->getName());
// Some architectures have additional ordering restrictions for sections
// within the same PT_LOAD.
if (Config->EMachine == EM_PPC64)
return getPPC64SectionRank(A->getName()) <
getPPC64SectionRank(B->getName());
return false;
}
// Until this function is called, common symbols do not belong to any section.