aboutsummaryrefslogtreecommitdiff
path: root/binutils/bucomm.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2019-06-26 17:03:32 +0100
committerNick Clifton <nickc@redhat.com>2019-06-26 17:03:32 +0100
commita68aa5d3020948564ef99d704d27e458ba22ad9d (patch)
treee413d62d4438b6a7605e7771c0028d89eba01e97 /binutils/bucomm.c
parent762c164d754fc456aa4764d2ed19cc4a3ec625fb (diff)
downloadgdb-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/bucomm.c')
-rw-r--r--binutils/bucomm.c12
1 files changed, 10 insertions, 2 deletions
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);