Restore GET_SAVED_REGISTERS
[deliverable/binutils-gdb.git] / bfd / elf32-mips.c
index 27ae18abb9823ec9e0c8acf472008a9fcec9f889..5ab839e06cda59a95c27c5ae73944efe912dfd03 100644 (file)
@@ -7593,6 +7593,13 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs)
 
       if (r_symndx < extsymoff)
        h = NULL;
+      else if (r_symndx >= extsymoff + (symtab_hdr->sh_size / symtab_hdr->sh_entsize))
+       {
+         (*_bfd_error_handler)
+           (_("Malformed reloc detected for section %s"), name);
+         bfd_set_error (bfd_error_bad_value);
+         return false;
+       }
       else
        {
          h = sym_hashes[r_symndx - extsymoff];
@@ -7750,7 +7757,7 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs)
                return false;
            }
 
-         if (SGI_COMPAT (dynobj))
+         if (SGI_COMPAT (abfd))
            mips_elf_hash_table (info)->compact_rel_size +=
              sizeof (Elf32_External_crinfo);
          break;
@@ -7759,7 +7766,7 @@ _bfd_mips_elf_check_relocs (abfd, info, sec, relocs)
        case R_MIPS_GPREL16:
        case R_MIPS_LITERAL:
        case R_MIPS_GPREL32:
-         if (SGI_COMPAT (dynobj))
+         if (SGI_COMPAT (abfd))
            mips_elf_hash_table (info)->compact_rel_size +=
              sizeof (Elf32_External_crinfo);
          break;
This page took 0.036984 seconds and 4 git commands to generate.