correct ft32 reloc range test
[deliverable/binutils-gdb.git] / bfd / elf32-rx.c
index 42f5fc21fb4ca4233b658d77e084e77951f193a3..1f70b97a34501b6c4864a6221296e835d695ae90 100644 (file)
@@ -300,10 +300,10 @@ rx_reloc_name_lookup (bfd * abfd ATTRIBUTE_UNUSED, const char * r_name)
 
 /* Set the howto pointer for an RX ELF reloc.  */
 
-static void
-rx_info_to_howto_rela (bfd *abfd,
-                      arelent *cache_ptr,
-                      Elf_Internal_Rela *dst)
+static bfd_boolean
+rx_info_to_howto_rela (bfd *              abfd,
+                      arelent *           cache_ptr,
+                      Elf_Internal_Rela * dst)
 {
   unsigned int r_type;
 
@@ -313,9 +313,19 @@ rx_info_to_howto_rela (bfd *abfd,
       /* xgettext:c-format */
       _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
                          abfd, r_type);
-      r_type = 0;
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
     }
   cache_ptr->howto = rx_elf_howto_table + r_type;
+  if (cache_ptr->howto->name == NULL)
+    {
+      /* xgettext:c-format */
+      _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+                         abfd, r_type);
+      bfd_set_error (bfd_error_bad_value);
+      return FALSE;
+    }
+  return TRUE;
 }
 \f
 static bfd_vma
This page took 0.023151 seconds and 4 git commands to generate.