+2016-02-01 Alan Modra <amodra@gmail.com>
+
+ * elf64-x86-64.c (elf_x86_64_get_plt_sym_val): Don't abort on
+ an out of range reloc_index.
+ * elf32-i386.c (elf_i386_get_plt_sym_val): Likewise.
+
2016-02-01 Kamil Rytarowski <n54@gmx.com>
* Makefile.am (OPTIONAL_BACKENDS): Add netbsd-core.lo.
reloc_index = H_GET_32 (abfd, (plt_contents + plt_offset
+ bed->plt->plt_reloc_offset));
reloc_index /= sizeof (Elf32_External_Rel);
- if (reloc_index >= count)
- abort ();
- plt_sym_val[reloc_index] = plt->vma + plt_offset;
+ if (reloc_index < count)
+ plt_sym_val[reloc_index] = plt->vma + plt_offset;
+
plt_offset += bed->plt->plt_entry_size;
/* PR binutils/18437: Skip extra relocations in the .rel.plt
reloc_index = H_GET_32 (abfd, (plt_contents + plt_offset
+ bed->plt_reloc_offset));
- if (reloc_index >= count)
- abort ();
- if (plt_bnd)
+ if (reloc_index < count)
{
- /* This is the index in .plt section. */
- long plt_index = plt_offset / bed->plt_entry_size;
- /* Store VMA + the offset in .plt.bnd section. */
- plt_sym_val[reloc_index] =
- (plt_bnd->vma
- + (plt_index - 1) * sizeof (elf_x86_64_legacy_plt2_entry));
+ if (plt_bnd)
+ {
+ /* This is the index in .plt section. */
+ long plt_index = plt_offset / bed->plt_entry_size;
+ /* Store VMA + the offset in .plt.bnd section. */
+ plt_sym_val[reloc_index] =
+ (plt_bnd->vma
+ + (plt_index - 1) * sizeof (elf_x86_64_legacy_plt2_entry));
+ }
+ else
+ plt_sym_val[reloc_index] = plt->vma + plt_offset;
}
- else
- plt_sym_val[reloc_index] = plt->vma + plt_offset;
plt_offset += bed->plt_entry_size;
/* PR binutils/18437: Skip extra relocations in the .rela.plt