[lld] r303781 - Move clearOutputSections earlier. NFC.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Wed May 24 10:54:29 PDT 2017


Author: rafael
Date: Wed May 24 12:54:28 2017
New Revision: 303781

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

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=303781&r1=303780&r2=303781&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Wed May 24 12:54:28 2017
@@ -291,6 +291,7 @@ template <class ELFT> void Writer<ELFT>:
   } else {
     writeSectionsBinary();
   }
+  clearOutputSections();
 
   // Backfill .note.gnu.build-id section content. This is done at last
   // because the content is usually a hash value of the entire output file.
@@ -298,7 +299,6 @@ template <class ELFT> void Writer<ELFT>:
   if (ErrorCount)
     return;
 
-  clearOutputSections();
 
   // Handle -Map option.
   writeMapFile<ELFT>(Script->Opt.Commands);




More information about the llvm-commits mailing list