[ELF] Fix TimeTraceScope for "Finalize .eh_frame"
authorFangrui Song <i@maskray.me>
Sat, 3 Dec 2022 18:00:51 +0000 (18:00 +0000)
committerFangrui Song <i@maskray.me>
Sat, 3 Dec 2022 18:00:51 +0000 (18:00 +0000)
lld/ELF/Writer.cpp

index 6f04b31..bde60e2 100644 (file)
@@ -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) {