aboutsummaryrefslogtreecommitdiff
path: root/bfd/bfd.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-11-18 12:31:55 +1030
committerAlan Modra <amodra@gmail.com>2019-11-18 22:06:09 +1030
commit9aea1e31371a883452e80bd96e8818289c3e6b6e (patch)
treec1a28a6b86dfa423cef5cb9cc6057deb8df83264 /bfd/bfd.c
parent66f8b2cbbb675ccbcae56e2bdb6dae485878ec00 (diff)
downloadgdb-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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bfd/bfd.c b/bfd/bfd.c
index 94e9f27..e92213b 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -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>")
};