From b5de5b93547d06809950af8e8b1bf72b4a373524 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 8 May 2017 16:49:20 +0000 Subject: [PATCH] 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. llvm-svn: 302441 --- lld/ELF/Writer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index 7f00e37..e0c6218 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -753,7 +753,8 @@ static bool compareSections(const OutputSection *A, const OutputSection *B) { if (AIndex != BIndex) return AIndex < BIndex; - return compareSectionsNonScript(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 void Writer::sortSections() { // .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. -- 2.7.4