[lld] r304436 - Move synchronize earlier.

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


Author: rafael
Date: Thu Jun  1 11:42:16 2017
New Revision: 304436

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

This is probably the correct location for it: next to
fabricateDefaultCommands. If we don't have a linker script, we
fabricate one. If we have one, we patch it.

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=304436&r1=304435&r2=304436&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Thu Jun  1 11:42:16 2017
@@ -261,6 +261,8 @@ template <class ELFT> void Writer<ELFT>:
     if (!Config->Relocatable)
       fixSectionAlignments();
     Script->fabricateDefaultCommands();
+  } else {
+    Script->synchronize();
   }
 
   for (BaseCommand *Base : Script->Opt.Commands)
@@ -273,7 +275,6 @@ template <class ELFT> void Writer<ELFT>:
   parallelForEach(OutputSections.begin(), OutputSections.end(),
                   [](OutputSection *S) { S->maybeCompress<ELFT>(); });
 
-  Script->synchronize();
   clearOutputSections();
 
   if (Config->Relocatable) {




More information about the llvm-commits mailing list