Index: ELF/SyntheticSections.cpp =================================================================== --- ELF/SyntheticSections.cpp +++ ELF/SyntheticSections.cpp @@ -1957,6 +1957,11 @@ } } + // Don't allow the section to shrink; otherwise the size of the section can + // oscillate infinitely. Trailing 1s do not decode to more relocations. + if (relrRelocs.size() < oldSize) + relrRelocs.resize(oldSize, Elf_Relr(1)); + return relrRelocs.size() != oldSize; }