Simplify by using Out<ELFT>::Opd.

Also avoid extra dependencies on the section name.

llvm-svn: 250159
This commit is contained in:
Rafael Espindola 2015-10-13 14:45:51 +00:00
parent 2b9b8a5921
commit 7a51305c91
1 changed files with 5 additions and 6 deletions

View File

@ -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());
}