+2014-12-16 Nick Clifton <nickc@redhat.com>
+
+ PR binutils/17512
+ * format.c (bfd_check_format_matches): Check for a matching vector
+ before using match priorities.
+ * mach-o.c (bfd_mach_o_canonicalize_one_reloc): Fix off-by-one
+ errors with previous delta.
+
2014-12-15 H.J. Lu <hongjiu.lu@intel.com>
PR ld/17713
/* We still have more than one equally good match, and at least some
of the targets support match priority. Choose the first of the
best matches. */
- if (match_count > 1 && best_count != match_count)
+ if (matching_vector && match_count > 1 && best_count != match_count)
{
int i;
if (reloc.r_extern)
{
/* PR 17512: file: 8396-1185-0.004. */
- if (num >= bfd_get_symcount (abfd))
+ if (bfd_get_symcount (abfd) > 0 && num > bfd_get_symcount (abfd))
sym = bfd_und_section_ptr->symbol_ptr_ptr;
else
/* An external symbol number. */
else
{
/* PR 17512: file: 006-2964-0.004. */
- if (num >= mdata->nsects)
+ if (num > mdata->nsects)
return -1;
/* A section number. */
if (!(*bed->_bfd_mach_o_swap_reloc_in)(res, &reloc))
return -1;
+
return 0;
}
/* Allocate and read relocs. */
native_size = count * BFD_MACH_O_RELENT_SIZE;
+
native_relocs =
(struct mach_o_reloc_info_external *) bfd_malloc (native_size);
if (native_relocs == NULL)