Imported Upstream version 7.9
[platform/upstream/gdb.git] / bfd / elf32-i960.c
index c6fbbb8..0fd00e0 100644 (file)
@@ -1,5 +1,5 @@
 /* Intel 960 specific support for 32-bit ELF
-   Copyright (C) 1999-2014 Free Software Foundation, Inc.
+   Copyright (C) 1999-2015 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -132,7 +132,13 @@ elf32_i960_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
   enum elf_i960_reloc_type type;
 
   type = (enum elf_i960_reloc_type) ELF32_R_TYPE (dst->r_info);
-  BFD_ASSERT (type < R_960_max);
+
+  /* PR 17521: file: 9609b8d6.  */
+  if (type >= R_960_max)
+    {
+      _bfd_error_handler (_("%A; invalid i960 reloc number: %d"), abfd, type);
+      type = 0;
+    }
 
   cache_ptr->howto = &elf_howto_table[(int) type];
 }