aboutsummaryrefslogtreecommitdiff
path: root/bfd
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1999-07-22 00:29:35 +0000
committerIan Lance Taylor <ian@airs.com>1999-07-22 00:29:35 +0000
commit75987f837d86a482443aab3c68a8b84afc600ce5 (patch)
tree35e3b29dfabbba96fd45a565f695253ef2898ed4 /bfd
parent0691c3ca1faffb9bb822bf11c3513c18bb98d87b (diff)
downloadgdb-75987f837d86a482443aab3c68a8b84afc600ce5.zip
gdb-75987f837d86a482443aab3c68a8b84afc600ce5.tar.gz
gdb-75987f837d86a482443aab3c68a8b84afc600ce5.tar.bz2
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.
Diffstat (limited to 'bfd')
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/cofflink.c8
2 files changed, 13 insertions, 0 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 6fb1b12..e1059ee 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -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
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index 994cea4..679e7a8 100644
--- a/bfd/cofflink.c
+++ b/bfd/cofflink.c
@@ -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];