diff options
author | Nick Clifton <nickc@redhat.com> | 2019-06-26 17:03:32 +0100 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2019-06-26 17:03:32 +0100 |
commit | a68aa5d3020948564ef99d704d27e458ba22ad9d (patch) | |
tree | e413d62d4438b6a7605e7771c0028d89eba01e97 /binutils | |
parent | 762c164d754fc456aa4764d2ed19cc4a3ec625fb (diff) | |
download | gdb-a68aa5d3020948564ef99d704d27e458ba22ad9d.zip gdb-a68aa5d3020948564ef99d704d27e458ba22ad9d.tar.gz gdb-a68aa5d3020948564ef99d704d27e458ba22ad9d.tar.bz2 |
Ensure that when attempting to process an ARM Mach-O file with unknown relocs, that a suitable error message is displayed.
PR 24703
binutils* bucomm.c (bfd_nonfatal): If no bfd error code has been set then
indicate this in the output.
(bfd_nonfatal_message): Likewise.
bfd * mach-o-arm.c (bfd_mach_o_arm_canonicalize_one_reloc): Add error
messages for failures.
* mach-o.c (bfd_mach_o_canonicalize_relocs): Set an bfd error code
if returning an error value.
Diffstat (limited to 'binutils')
-rw-r--r-- | binutils/ChangeLog | 7 | ||||
-rw-r--r-- | binutils/bucomm.c | 12 |
2 files changed, 17 insertions, 2 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog index 63822e4..07c8bb6 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -1,3 +1,10 @@ +2019-06-26 Nick Clifton <nickc@redhat.com> + + PR 24703 + * bucomm.c (bfd_nonfatal): If no bfd error code has been set then + indicate this in the output. + (bfd_nonfatal_message): Likewise. + 2019-06-25 Jan Beulich <jbeulich@suse.com> * readelf.c (dump_ctf_indent_lines): Rename local variable diff --git a/binutils/bucomm.c b/binutils/bucomm.c index 558ee2f..21adb05 100644 --- a/binutils/bucomm.c +++ b/binutils/bucomm.c @@ -44,8 +44,12 @@ void bfd_nonfatal (const char *string) { const char *errmsg; + enum bfd_error err = bfd_get_error (); - errmsg = bfd_errmsg (bfd_get_error ()); + if (err == bfd_error_no_error) + errmsg = _("cause of error unknown"); + else + errmsg = bfd_errmsg (err); fflush (stdout); if (string) fprintf (stderr, "%s: %s: %s\n", program_name, string, errmsg); @@ -74,8 +78,12 @@ bfd_nonfatal_message (const char *filename, const char *errmsg; const char *section_name; va_list args; + enum bfd_error err = bfd_get_error (); - errmsg = bfd_errmsg (bfd_get_error ()); + if (err == bfd_error_no_error) + errmsg = _("cause of error unknown"); + else + errmsg = bfd_errmsg (err); fflush (stdout); section_name = NULL; va_start (args, format); |