From 1998ee53f03bd70e811760a6aeb583ee4f4b033a Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Thu, 22 Sep 2016 17:23:53 +0000 Subject: [PATCH] Simplify. NFC. With the recent changes there should always be a 1:1 correspondence in the correct order between OutputSections and OutputSectionCommands. llvm-svn: 282176 --- lld/ELF/LinkerScript.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lld/ELF/LinkerScript.cpp b/lld/ELF/LinkerScript.cpp index d4577c2..cfb1fb3 100644 --- a/lld/ELF/LinkerScript.cpp +++ b/lld/ELF/LinkerScript.cpp @@ -546,9 +546,7 @@ template void LinkerScript::assignAddresses() { Opt.Commands.insert(CmdIter, llvm::make_unique(Name)); } else { - // If linker script lists alloc/non-alloc sections is the wrong order, - // this does a rotate to bring the desired command in place. - std::rotate(CmdIter, Pos, Pos + 1); + assert(Pos == CmdIter && "Section order doesn't match the linker script"); } ++CmdIndex; } -- 2.7.4