PR28172, bfin_pcrel24_reloc heap-buffer-overflow
authorAlan Modra <amodra@gmail.com>
Fri, 6 Aug 2021 07:56:14 +0000 (17:26 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 6 Aug 2021 13:32:27 +0000 (23:02 +0930)
commit352bd3aa1c68137d4a5115183f42c40b75ee05b3
treed202236bdae4f73c88a48c8d1fdaf65720b2c6cc
parent8179e388b60acc6ac35b40cd154f8d56234d1c3b
PR28172, bfin_pcrel24_reloc heap-buffer-overflow

bfin pcrel24 relocs are weird, they apply to the reloc address minus
two.  That means reloc addresses of 0 and 1 are invalid.  Check that,
and fix other reloc range checking.

PR 28172
* elf32-bfin.c (bfin_pcrel24_reloc): Correct reloc range check.
(bfin_imm16_reloc, bfin_byte4_reloc, bfin_bfd_reloc): Likewise.
(bfin_final_link_relocate): Likewise.
bfd/elf32-bfin.c