diff options
author | Alan Modra <amodra@gmail.com> | 2019-11-18 12:31:55 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2019-11-18 22:06:09 +1030 |
commit | 9aea1e31371a883452e80bd96e8818289c3e6b6e (patch) | |
tree | c1a28a6b86dfa423cef5cb9cc6057deb8df83264 /bfd/bfd.c | |
parent | 66f8b2cbbb675ccbcae56e2bdb6dae485878ec00 (diff) | |
download | gdb-9aea1e31371a883452e80bd96e8818289c3e6b6e.zip gdb-9aea1e31371a883452e80bd96e8818289c3e6b6e.tar.gz gdb-9aea1e31371a883452e80bd96e8818289c3e6b6e.tar.bz2 |
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.
Diffstat (limited to 'bfd/bfd.c')
-rw-r--r-- | bfd/bfd.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -655,6 +655,7 @@ CODE_FRAGMENT . bfd_error_bad_value, . bfd_error_file_truncated, . bfd_error_file_too_big, +. bfd_error_sorry, . bfd_error_on_input, . bfd_error_invalid_error_code .} @@ -688,6 +689,7 @@ const char *const bfd_errmsgs[] = N_("bad value"), N_("file truncated"), N_("file too big"), + N_("sorry, cannot handle this file"), N_("error reading %s: %s"), N_("#<invalid error code>") }; |