PR 26521
* elf.c (_bfd_elf_write_secondary_reloc_section): Check for
secondary reloc sections with a zero sh_entsize field.
+2020-09-03 Nick Clifton <nickc@redhat.com>
+
+ PR 26521
+ * elf.c (_bfd_elf_write_secondary_reloc_section): Check for
+ secondary reloc sections with a zero sh_entsize field.
+
2020-09-03 Nelson Chu <nelson.chu@sifive.com>
* elfnn-riscv.c (riscv_i_or_e_p): Minor cleanup for warnings/errors.
continue;
}
+ if (hdr->sh_entsize == 0)
+ {
+ _bfd_error_handler
+ /* xgettext:c-format */
+ (_("%pB(%pA): error: secondary reloc section has zero sized entries"),
+ abfd, relsec);
+ bfd_set_error (bfd_error_bad_value);
+ result = FALSE;
+ continue;
+ }
+
reloc_count = hdr->sh_size / hdr->sh_entsize;
if (reloc_count <= 0)
{