1999-07-21 Philippe De Muyter <phdm@macqel.be>
authorIan Lance Taylor <ian@airs.com>
Thu, 22 Jul 1999 00:29:35 +0000 (00:29 +0000)
committerIan Lance Taylor <ian@airs.com>
Thu, 22 Jul 1999 00:29:35 +0000 (00:29 +0000)
* cofflink.c (_bfd_coff_generic_relocate_section): Issue an error
message and fail if a symbol index is out of range.

bfd/ChangeLog
bfd/cofflink.c

index 6fb1b12ba2b1da171a37539ffb6796da734f24dc..e1059ee9bf6887fbb482334913073d920f0829d6 100644 (file)
@@ -1,3 +1,8 @@
+1999-07-21  Philippe De Muyter  <phdm@macqel.be>
+
+       * cofflink.c (_bfd_coff_generic_relocate_section): Issue an error
+       message and fail if a symbol index is out of range.
+
 1999-07-21  Ian Lance Taylor  <ian@zembu.com>
 
        * elf32-mips.c (mips_elf_calculate_relocation): Get the GP value
index 994cea498ea364aabab546081f9dd580f2fdd43c..679e7a84d87abf5c485b498d7f4958246cfa229f 100644 (file)
@@ -2603,6 +2603,14 @@ _bfd_coff_generic_relocate_section (output_bfd, info, input_bfd,
          h = NULL;
          sym = NULL;
        }
+      else if (symndx < 0
+              || (unsigned long) symndx >= obj_raw_syment_count (input_bfd))
+       {
+         (*_bfd_error_handler)
+           ("%s: illegal symbol index %ld in relocs",
+            bfd_get_filename (input_bfd), symndx);
+         return false;
+       }
       else
        {    
          h = obj_coff_sym_hashes (input_bfd)[symndx];