]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit - bfd/bfd-in2.h
PR25196, abort in rewrite_elf_program_header
authorAlan Modra <amodra@gmail.com>
Mon, 18 Nov 2019 02:01:55 +0000 (12:31 +1030)
committerAlan Modra <amodra@gmail.com>
Mon, 18 Nov 2019 11:36:09 +0000 (22:06 +1030)
commit9aea1e31371a883452e80bd96e8818289c3e6b6e
treec1a28a6b86dfa423cef5cb9cc6057deb8df83264
parent66f8b2cbbb675ccbcae56e2bdb6dae485878ec00
PR25196, abort in rewrite_elf_program_header

This patch introduces a new "sorry, cannot handle this file" bfd error
status.  The idea is to use this error in cases where bfd hasn't found
a bfd_bad_value error, ie. an input file or set of options that are
invalid, but rather an input file that is simply too difficult to
process.  Typically this might happen with fuzzed object files such as
the one in the PR, a wildly improbable core file.  Some things are
just not worth wasting time over to fix "properly".

PR 25196
* bfd.c (bfd_error_type): Add bfd_error_sorry.
(bfd_errmsgs): Likewise.
* elf.c (rewrite_elf_program_header): Don't abort on confused
lma/alignment.  Replace bfd_error_bad_value with bfd_error_sorry.
(_bfd_elf_validate_reloc): Use bfd_error_sorry.
(_bfd_elf_final_write_processing): Likewise.
* bfd-in2.h: Regenerate.
bfd/ChangeLog
bfd/bfd-in2.h
bfd/bfd.c
bfd/elf.c