+2019-06-26 Nick Clifton <nickc@redhat.com>
+
+ PR 24703
+ * 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.
+
2019-06-25 Jan Beulich <jbeulich@suse.com>
* elf-properties.c (elf_find_and_remove_property): Rename last
bfd_mach_o_reloc_info reloc;
if (!bfd_mach_o_pre_canonicalize_one_reloc (abfd, raw, &reloc, res, syms))
+ {
+fprintf (stderr, "ARm 1\n");
return FALSE;
+ }
if (reloc.r_scattered)
{
case BFD_MACH_O_ARM_RELOC_PAIR:
/* PR 21813: Check for a corrupt PAIR reloc at the start. */
if (res == res_base)
+ {
+ _bfd_error_handler (_("\
+malformed mach-o ARM reloc pair: reloc is first reloc"));
return FALSE;
+ }
if (reloc.r_length == 2)
{
res->howto = &arm_howto_table[7];
res->address = res[-1].address;
return TRUE;
}
+ _bfd_error_handler (_("\
+malformed mach-o ARM reloc pair: invalid length: %d"), reloc.r_length);
return FALSE;
case BFD_MACH_O_ARM_RELOC_SECTDIFF:
res->howto = &arm_howto_table[8];
return TRUE;
}
+ _bfd_error_handler (_("\
+malformed mach-o ARM sectdiff reloc: invalid length: %d"), reloc.r_length);
return FALSE;
case BFD_MACH_O_ARM_RELOC_LOCAL_SECTDIFF:
res->howto = &arm_howto_table[9];
return TRUE;
}
+ _bfd_error_handler (_("\
+malformed mach-o ARM local sectdiff reloc: invalid length: %d"),
+ reloc.r_length);
return FALSE;
case BFD_MACH_O_ARM_RELOC_HALF_SECTDIFF:
res->howto = &arm_howto_table[14];
return TRUE;
}
+ _bfd_error_handler (_("\
+malformed mach-o ARM half sectdiff reloc: invalid length: %d"),
+ reloc.r_length);
return FALSE;
default:
res->howto = &arm_howto_table[3];
return TRUE;
default:
+ _bfd_error_handler (_("\
+malformed mach-o ARM vanilla reloc: invalid length: %d (pcrel: %d)"),
+ reloc.r_length, reloc.r_pcrel);
return FALSE;
}
break;
}
}
+ _bfd_error_handler (_("\
+malformed mach-o ARM reloc: unknown reloc type: %d"), reloc.r_length);
return FALSE;
}
{
/* PR 17512: file: 006-2964-0.004. */
if (num > mdata->nsects)
- return FALSE;
+ {
+ _bfd_error_handler (_("\
+malformed mach-o reloc: section index is greater than the number of sections"));
+ return FALSE;
+ }
/* A section number. */
sym = mdata->sections[num - 1]->bfdsection->symbol_ptr_ptr;
{
bfd_mach_o_backend_data *bed = bfd_mach_o_get_backend_data (abfd);
unsigned long i;
- struct mach_o_reloc_info_external *native_relocs;
+ struct mach_o_reloc_info_external *native_relocs = NULL;
bfd_size_type native_size;
/* Allocate and read relocs. */
/* PR 17512: file: 09477b57. */
if (native_size < count)
- return -1;
+ goto err;
native_relocs =
(struct mach_o_reloc_info_external *) bfd_malloc (native_size);
}
free (native_relocs);
return i;
+
err:
free (native_relocs);
+ if (bfd_get_error () == bfd_error_no_error)
+ bfd_set_error (bfd_error_invalid_operation);
return -1;
}
+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
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);
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);