mips and score check_relocs r_symndx upper bound
Checks
Commit Message
The maximum allowed r_symndx is fairly obviously that of the last
symbol in .symtab. Also, sym_hashes is indexed by r_symndx-extsymoff
and sized as NUM_SHDR_ENTRIES-extsymoff. extsymoff cancels.
(And yes, I delete this check entirely with a later patch.)
* elfxx-mips.c (_bfd_mips_elf_check_relocs): Correct upper
bound for r_symndx.
* elf32-score.c (s3_bfd_score_elf_check_relocs): Likewise.
* elf32-score7.c (s7_bfd_score_elf_check_relocs): Likewise.
@@ -2843,7 +2843,7 @@ s3_bfd_score_elf_check_relocs (bfd *abfd,
{
h = NULL;
}
- else if (r_symndx >= extsymoff + NUM_SHDR_ENTRIES (symtab_hdr))
+ else if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{
_bfd_error_handler
/* xgettext:c-format */
@@ -2645,7 +2645,7 @@ s7_bfd_score_elf_check_relocs (bfd *abfd,
{
h = NULL;
}
- else if (r_symndx >= extsymoff + NUM_SHDR_ENTRIES (symtab_hdr))
+ else if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{
_bfd_error_handler
/* xgettext:c-format */
@@ -8794,7 +8794,7 @@ _bfd_mips_elf_check_relocs (bfd *abfd, struct bfd_link_info *info,
if (r_symndx < extsymoff)
h = NULL;
- else if (r_symndx >= extsymoff + NUM_SHDR_ENTRIES (symtab_hdr))
+ else if (r_symndx >= NUM_SHDR_ENTRIES (symtab_hdr))
{
_bfd_error_handler
/* xgettext:c-format */