[lld] r302441 - Simplify orphan section positioning.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Mon May 8 09:49:21 PDT 2017
Author: rafael
Date: Mon May 8 11:49:20 2017
New Revision: 302441
URL: http://llvm.org/viewvc/llvm-project?rev=302441&view=rev
Log:
Simplify orphan section positioning.
The code following this one already considers every possible insertion
point for orphan sections, there is no point in sorting them before.
Modified:
lld/trunk/ELF/Writer.cpp
Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=302441&r1=302440&r2=302441&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Mon May 8 11:49:20 2017
@@ -753,7 +753,8 @@ static bool compareSections(const Output
if (AIndex != BIndex)
return AIndex < BIndex;
- return compareSectionsNonScript<ELFT>(A, B);
+ // The sections are not in the linker script, so don't sort for now.
+ return false;
}
// Program header entry
@@ -1004,8 +1005,7 @@ template <class ELFT> void Writer<ELFT>:
// .d (ro) # not in script
//
// The way we define an order then is:
- // * First put script sections at the start and sort the script and
- // non-script sections independently.
+ // * First put script sections at the start and sort the script sections.
// * Move each non-script section to its preferred position. We try
// to put each section in the last position where it it can share
// a PT_LOAD.
More information about the llvm-commits
mailing list