[lld] r304434 - Move clearOutputSections earlier.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 1 09:32:59 PDT 2017


Author: rafael
Date: Thu Jun  1 11:32:58 2017
New Revision: 304434

URL: http://llvm.org/viewvc/llvm-project?rev=304434&view=rev
Log:
Move clearOutputSections earlier.

Now it is as early as it can go: just before synchronize. We now have
to move synchronize earlier too.

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=304434&r1=304433&r2=304434&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu Jun  1 11:32:58 2017
@@ -274,6 +274,7 @@ template <class ELFT> void Writer<ELFT>:
                   [](OutputSection *S) { S->maybeCompress<ELFT>(); });
 
   Script->synchronize();
+  clearOutputSections();
 
   if (Config->Relocatable) {
     assignFileOffsets();
@@ -301,7 +302,7 @@ template <class ELFT> void Writer<ELFT>:
   openFile();
   if (ErrorCount)
     return;
-  clearOutputSections();
+
   if (!Config->OFormatBinary) {
     writeHeader();
     writeSections();




More information about the llvm-commits mailing list