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.
This commit is contained in:
Nick Clifton
2019-06-26 17:03:32 +01:00
parent 762c164d75
commit a68aa5d302
5 changed files with 57 additions and 5 deletions

View File

@ -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);