From 4d91f7fc259b1ca1f9a6e9b38d2f667e407481b3 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 1 Feb 2016 21:52:00 +0000 Subject: [PATCH] Simplify. Now that we remember the StringRefs when they are first added, we can write the table in any order. llvm-svn: 259417 --- lld/ELF/Writer.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index c65be55..f8f6215 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1339,17 +1339,8 @@ template void Writer::writeSections() { Sec->writeTo(Buf + Sec->getFileOff()); } - // Write all sections but string table sections. We know the sizes of the - // string tables already, but they may not have actual strings yet (only - // room may be reserved), because writeTo() is allowed to add actual - // strings to the string tables. for (OutputSectionBase *Sec : OutputSections) - if (Sec != Out::Opd && Sec->getType() != SHT_STRTAB) - Sec->writeTo(Buf + Sec->getFileOff()); - - // Write string table sections. - for (OutputSectionBase *Sec : OutputSections) - if (Sec != Out::Opd && Sec->getType() == SHT_STRTAB) + if (Sec != Out::Opd) Sec->writeTo(Buf + Sec->getFileOff()); } -- 2.7.4