Simplify by using Out<ELFT>::Opd.
Also avoid extra dependencies on the section name. llvm-svn: 250159
This commit is contained in:
parent
2b9b8a5921
commit
7a51305c91
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue