diff options
-rw-r--r-- | lld/ELF/Writer.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp index c65be556ba1..f8f6215003b 100644 --- a/lld/ELF/Writer.cpp +++ b/lld/ELF/Writer.cpp @@ -1339,17 +1339,8 @@ template <class ELFT> void Writer<ELFT>::writeSections() { Sec->writeTo(Buf + Sec->getFileOff()); } - // Write all sections but string table sections. We know the sizes of the - // string tables already, but they may not have actual strings yet (only - // room may be reserved), because writeTo() is allowed to add actual - // strings to the string tables. for (OutputSectionBase<ELFT> *Sec : OutputSections) - if (Sec != Out<ELFT>::Opd && Sec->getType() != SHT_STRTAB) - Sec->writeTo(Buf + Sec->getFileOff()); - - // Write string table sections. - for (OutputSectionBase<ELFT> *Sec : OutputSections) - if (Sec != Out<ELFT>::Opd && Sec->getType() == SHT_STRTAB) + if (Sec != Out<ELFT>::Opd) Sec->writeTo(Buf + Sec->getFileOff()); } |