ELF2: Remove setNameOffset and combine that with writeHeader. NFC.

llvm-svn: 251193
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index e21a45d..76b7e1b 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -740,10 +740,8 @@
   auto SHdrs = reinterpret_cast<Elf_Shdr *>(Buf + EHdr->e_shoff);
   // First entry is null.
   ++SHdrs;
-  for (OutputSectionBase<ELFT> *Sec : OutputSections) {
-    Sec->setNameOffset(Out<ELFT>::ShStrTab->getOffset(Sec->getName()));
+  for (OutputSectionBase<ELFT> *Sec : OutputSections)
     Sec->writeHeaderTo(SHdrs++);
-  }
 }
 
 template <class ELFT> void Writer<ELFT>::openFile(StringRef Path) {