From microsoft docs: It is an error if IMAGE_SCN_LNK_NRELOC_OVFL is
set and there are fewer than 0xffff relocations in the section.
* coffcode.h (coff_set_alignment_hook): Sanity check overflow
reloc count.
coff_swap_reloc_in (abfd, &dst, &n);
if (bfd_seek (abfd, oldpos, 0) != 0)
return;
+ if (n.r_vaddr < 0xffff)
+ {
+ _bfd_error_handler (_("%pB: overflow reloc count too small"), abfd);
+ bfd_set_error (bfd_error_bad_value);
+ return;
+ }
section->reloc_count = hdr->s_nreloc = n.r_vaddr - 1;
section->rel_filepos += relsz;
}