PowerPC64, sanity check r_offset in relocate_section
authorAlan Modra <amodra@gmail.com>
Wed, 8 Sep 2021 03:48:02 +0000 (13:18 +0930)
committerAlan Modra <amodra@gmail.com>
Wed, 8 Sep 2021 12:52:34 +0000 (22:22 +0930)
commit733ae98cb8fb0d5653887cfd79aec3cfe5e44846
tree98dcd9c74201869ba26ae57e9d6931c3bbd1cf32
parentbeaddc1a805d70131ffbeaee4d8d4ba41b9e5a2e
PowerPC64, sanity check r_offset in relocate_section

This hardens the powerpc64 linker code transformations.

* elf64-ppc.c (is_8byte_reloc, offset_in_range): New functions.
(ppc64_elf_relocate_section): Sanity check r_offset before
accessing section contents for various code transformations.
bfd/elf64-ppc.c