summaryrefslogtreecommitdiff
path: root/bfd/cofflink.c
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
commit1f66f24c112bdea5fb5a877d60fe8a7c628a4a4b (patch)
tree753089a9ed7b939223679d594a6f6861573dba16 /bfd/cofflink.c
parent2ec56ecdc9648ea9f875eeb7f3dae4d84927d782 (diff)
downloadgdb-1f66f24c112bdea5fb5a877d60fe8a7c628a4a4b.tar.gz
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/cofflink.c')
-rw-r--r--bfd/cofflink.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bfd/cofflink.c b/bfd/cofflink.c
index 994cea498ea..679e7a84d87 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];