Index: ELF/Writer.cpp =================================================================== --- ELF/Writer.cpp +++ ELF/Writer.cpp @@ -974,6 +974,10 @@ for (OutputSectionBase *Sec : OutputSections) Sec->finalize(); + // Make room for a sentinel. + if (OutputSectionBase *Sec = findSection(".ARM.exidx")) + Sec->Size += 8; + // Dynamic section must be the last one in this list and dynamic // symbol table section (DynSymTab) must be the first one. finalizeSynthetic( @@ -1531,6 +1535,9 @@ // it should be written after .eh_frame is written. if (!Out::EhFrame->empty() && Out::EhFrameHdr) Out::EhFrameHdr->writeTo(Buf + Out::EhFrameHdr->Offset); + + if (OutputSectionBase *Sec = findSection(".ARM.exidx")) + // write sentinel } template void Writer::writeBuildId() {