Use ui_file_as_string in gdb/printcmd.c
[binutils-gdb.git] / bfd / elf32-i960.c
index c6fbbb8c493eaf09330b524f9de3b52d4a87dba2..292d969af153d0da4aaafc1c90d915bfd9669fab 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-2016 Free Software Foundation, Inc.
 
    This file is part of BFD, the Binary File Descriptor library.
 
@@ -83,7 +83,7 @@ elf32_i960_relocate (bfd *abfd ATTRIBUTE_UNUSED,
 
 static reloc_howto_type elf_howto_table[]=
 {
-  HOWTO (R_960_NONE, 0, 0, 0, FALSE, 0, complain_overflow_bitfield,
+  HOWTO (R_960_NONE, 0, 3, 0, FALSE, 0, complain_overflow_dont,
         elf32_i960_relocate, "R_960_NONE", TRUE,
         0x00000000, 0x00000000, FALSE),
   EMPTY_HOWTO (1),
@@ -132,7 +132,14 @@ 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)
+    {
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%B: invalid i960 reloc number: %d"), abfd, type);
+      type = 0;
+    }
 
   cache_ptr->howto = &elf_howto_table[(int) type];
 }