]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - bfd/elf32-ppc.c
PR23980, assertion fail
authorAlan Modra <amodra@gmail.com>
Mon, 17 Dec 2018 22:50:06 +0000 (09:20 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 18 Dec 2018 00:17:02 +0000 (10:47 +1030)
commit7af5d5c4dda26ac36ee2ff42af8f39a10382cc41
treeea96ed2204aee3212b07516b827b30a0b779192f
parentc5ebe0ff706521b4a5fb66a5e764031825276ad5
PR23980, assertion fail

All of the backend relocate_section functions that interpret reloc
numbers assuming the input file is of the expected type (ie. same as
output or very similar) really ought to be checking input file type.
Not many do, and those that do currently just assert.  This patch
replaces the assertion with a more graceful exit.

PR 23980
* elf32-i386.c (elf_i386_relocate_section): Exit with wrong format
error rather than asserting input file is as expected.
* elf32-s390.c (elf_s390_relocate_section): Likewise.
* elf32-sh.c (sh_elf_relocate_section): Likewise.
* elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
* elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
* elf64-s390.c (elf_s390_relocate_section): Likewise.
* elf64-x86-64.c (elf_x86_64_relocate_section): Likewise.
* elf32-ppc.c (ppc_elf_relocate_section): Exit with wrong format
error if input file is not ppc32 ELF.
bfd/ChangeLog
bfd/elf32-i386.c
bfd/elf32-ppc.c
bfd/elf32-s390.c
bfd/elf32-sh.c
bfd/elf32-xtensa.c
bfd/elf64-ppc.c
bfd/elf64-s390.c
bfd/elf64-x86-64.c