* elf32-mips.c (mips_elf_check_relocs): Give an error if CALL16 is
authorIan Lance Taylor <ian@airs.com>
Sat, 15 Mar 1997 02:16:30 +0000 (02:16 +0000)
committerIan Lance Taylor <ian@airs.com>
Sat, 15 Mar 1997 02:16:30 +0000 (02:16 +0000)
  seen with a local symbol, rather than crashing.

bfd/ChangeLog
bfd/elf32-mips.c

index 3043436..c000847 100644 (file)
@@ -1,5 +1,8 @@
 Fri Mar 14 16:43:22 1997  Ian Lance Taylor  <ian@cygnus.com>
 
+       * elf32-mips.c (mips_elf_check_relocs): Give an error if CALL16 is
+       seen with a local symbol, rather than crashing.
+
        * elfcode.h (elf_slurp_symbol_table): Don't try to read the
        version symbols if there aren't any.
 
index d0369e5..f7ae2ea 100644 (file)
@@ -5868,7 +5868,14 @@ mips_elf_check_relocs (abfd, info, sec, relocs)
        case R_MIPS_CALL_LO16:
          /* This symbol requires a global offset table entry.  */
 
-         BFD_ASSERT (h != NULL);
+         if (h == NULL)
+           {
+             (*_bfd_error_handler)
+               ("%s: CALL16 reloc at 0x%lx not against global symbol",
+                bfd_get_filename (abfd), (unsigned long) rel->r_offset);
+             bfd_set_error (bfd_error_bad_value);
+             return false;
+           }
 
          /* Make sure this symbol is output as a dynamic symbol.  */
          if (h->dynindx == -1)