[lld] d98c172 - [ELF] Fix TimeTraceScope for "Finalize .eh_frame"

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 3 10:00:57 PST 2022


Author: Fangrui Song
Date: 2022-12-03T18:00:51Z
New Revision: d98c17271265f54a5c6ad07b2094f9b5bf3a34cc

URL: https://github.com/llvm/llvm-project/commit/d98c17271265f54a5c6ad07b2094f9b5bf3a34cc
DIFF: https://github.com/llvm/llvm-project/commit/d98c17271265f54a5c6ad07b2094f9b5bf3a34cc.diff

LOG: [ELF] Fix TimeTraceScope for "Finalize .eh_frame"

Added: 
    

Modified: 
    lld/ELF/Writer.cpp

Removed: 
    


################################################################################
diff  --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 6f04b31c57233..bde60e230ce83 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -1882,15 +1882,15 @@ template <class ELFT> void Writer<ELFT>::finalizeSections() {
         ElfSym::tlsModuleBase = cast<Defined>(s);
       }
     }
-  }
 
-  if (!config->relocatable) {
-    llvm::TimeTraceScope timeScope("Finalize .eh_frame");
     // This responsible for splitting up .eh_frame section into
     // pieces. The relocation scan uses those pieces, so this has to be
     // earlier.
-    for (Partition &part : partitions)
-      finalizeSynthetic(part.ehFrame.get());
+    {
+      llvm::TimeTraceScope timeScope("Finalize .eh_frame");
+      for (Partition &part : partitions)
+        finalizeSynthetic(part.ehFrame.get());
+    }
 
     if (config->hasDynSymTab) {
       parallelForEach(symtab.getSymbols(), [](Symbol *sym) {


        


More information about the llvm-commits mailing list