bfd, sparc: issue an error when reading relocations with invalid symbol references.
The function `elf64_sparc_slurp_one_reloc_table' in elf64-sparc.c
currently checks that the symbol indexes read in the r_sym fields of
relocations are in range. This is done for both dynamic and
non-dynamic symbols. This avoids subsequent invalid memory accesses.
However, no error is issued to the user.
This patch makes BFD to issue an error when the read symbol index is
out of range, following the same behavior implemented in both the
generic ELF routines and other ELF backends (such as mips64).
Tested in x86_64-linux-gnu, sparc64-linux-gnu, and
--enable-targets=all.
2018-09-04 Jose E. Marchesi <jose.marchesi@oracle.com>
* elf64-sparc.c (elf64_sparc_slurp_one_reloc_table): Issue an
error when an invalid symbol index is retrieved in ELF64_R_SYM of
a relocation seen in an input file.