summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-02-01 21:52:00 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-02-01 21:52:00 +0000
commit4d91f7fc259b1ca1f9a6e9b38d2f667e407481b3 (patch)
treeb63656462d05ddf8af44f9a6853b491c221222b5
parente9848d4a8873d68d68bd444c944d42be9a92ef24 (diff)
downloadbcm5719-llvm-4d91f7fc259b1ca1f9a6e9b38d2f667e407481b3.tar.gz
bcm5719-llvm-4d91f7fc259b1ca1f9a6e9b38d2f667e407481b3.zip
Simplify.
Now that we remember the StringRefs when they are first added, we can write the table in any order. llvm-svn: 259417
-rw-r--r--lld/ELF/Writer.cpp11
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());
}
OpenPOWER on IntegriCloud