]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
PR 33223 ppc64: segfault on unknown relocation
authorAlan Modra <amodra@gmail.com>
Tue, 29 Jul 2025 01:09:51 +0000 (10:39 +0930)
committerAlan Modra <amodra@gmail.com>
Tue, 29 Jul 2025 12:55:21 +0000 (22:25 +0930)
commit8fd6a9c70b4b67541dbafba64d0e215eada05ff1
treed5de758ec8f67ec0be1092062cab69ad650b8b81
parente2a18d03badd9dcbb0b0f352c326f1e7998cd02c
PR 33223 ppc64: segfault on unknown relocation

Bounds check accesses to ppc64_elf_howto_table and don't dereference a
NULL howto.  I think this catches all cases where that might happen.

PR 33223
bfd/
* elf64-ppc.c (ppc64_elf_info_to_howto): Consolidate error handling.
(ppc64_elf_check_relocs): Tidy error messages.
(ppc64_elf_relocate_section): Don't segfault when attempting to
report an unsupported relocation.  Don't pass a NULL howto to
_bfd_clear_contents.
ld/
* testsuite/ld-powerpc/elfv2-2so.d: Adjust to suit error message
change.
bfd/elf64-ppc.c
ld/testsuite/ld-powerpc/elfv2-2so.d