summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2015-10-13 14:45:51 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2015-10-13 14:45:51 +0000
commit7a51305c91d5218914a454a3908bb9ace767410f (patch)
tree8b32f209a79b8496e9b4659e14f2be849bb41bf7
parent2b9b8a5921c8929db460dedd4b05ee02aa58af82 (diff)
downloadbcm5719-llvm-7a51305c91d5218914a454a3908bb9ace767410f.tar.gz
bcm5719-llvm-7a51305c91d5218914a454a3908bb9ace767410f.zip
Simplify by using Out<ELFT>::Opd.
Also avoid extra dependencies on the section name. llvm-svn: 250159
-rw-r--r--lld/ELF/Writer.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index 8e6b4c5eef8..d5b61a6da92 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -651,14 +651,13 @@ template <class ELFT> void Writer<ELFT>::writeSections() {
// PPC64 needs to process relocations in the .opd section before processing
// relocations in code-containing sections.
- for (OutputSectionBase<ELFT::Is64Bits> *&Sec : OutputSections)
- if (Sec->getName() == ".opd") {
- Out<ELFT>::OpdBuf = Buf + Sec->getFileOff();
- Sec->writeTo(Buf + Sec->getFileOff());
- }
+ if (OutputSectionBase<ELFT::Is64Bits> *Sec = Out<ELFT>::Opd) {
+ Out<ELFT>::OpdBuf = Buf + Sec->getFileOff();
+ Sec->writeTo(Buf + Sec->getFileOff());
+ }
for (OutputSectionBase<ELFT::Is64Bits> *Sec : OutputSections)
- if (Sec->getName() != ".opd")
+ if (Sec != Out<ELFT>::Opd)
Sec->writeTo(Buf + Sec->getFileOff());
}
OpenPOWER on IntegriCloud