diff options
author | Hal Finkel <hfinkel@anl.gov> | 2015-10-13 19:07:29 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2015-10-13 19:07:29 +0000 |
commit | 9abc2a50b351acabfba3b0737f0f3d45a1f2053a (patch) | |
tree | 43dc7f1a8ce8ac6aa47e927dfb705e649c984f89 | |
parent | deac4909c7b3d2d4e1da81203e1547e53c1ec8fd (diff) | |
download | llvm-9abc2a50b351acabfba3b0737f0f3d45a1f2053a.zip llvm-9abc2a50b351acabfba3b0737f0f3d45a1f2053a.tar.gz llvm-9abc2a50b351acabfba3b0737f0f3d45a1f2053a.tar.bz2 |
[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
-rw-r--r-- | lld/ELF/Writer.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 484989b..52d46b5 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -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. |