Convert MipsReginfoSection to SyntheticSection.

llvm-svn: 287614
This commit is contained in:
Rui Ueyama
2016-11-22 03:57:08 +00:00
parent 12f2da870e
commit b71cae90de
3 changed files with 58 additions and 42 deletions

View File

@@ -318,10 +318,9 @@ template <class ELFT> void Writer<ELFT>::createSyntheticSections() {
Symtab<ELFT>::X->Sections.push_back(OptSec);
}
// MIPS .reginfo
auto *RegSec = make<MipsReginfoSection<ELFT>>();
if (RegSec->Live) {
In<ELFT>::MipsReginfo = RegSec;
Symtab<ELFT>::X->Sections.push_back(RegSec);
if (auto *Sec = MipsReginfoSection<ELFT>::create()) {
In<ELFT>::MipsReginfo = Sec;
Symtab<ELFT>::X->Sections.push_back(Sec);
}
}
@@ -1500,10 +1499,8 @@ template <class ELFT> void Writer<ELFT>::writeSectionsBinary() {
template <class ELFT> void Writer<ELFT>::writeSections() {
uint8_t *Buf = Buffer->getBufferStart();
// Finalize MIPS .reginfo and .MIPS.options sections
// because they contain offsets to .got and _gp.
if (In<ELFT>::MipsReginfo)
In<ELFT>::MipsReginfo->finalize();
// Finalize MIPS .MIPS.options sections because that contains
// offsets to .got and _gp.
if (In<ELFT>::MipsOptions)
In<ELFT>::MipsOptions->finalize();