RISC-V: Delete zero-size .tdata.dyn section.
[deliverable/binutils-gdb.git] / bfd / elf32-msp430.c
index 9f2a3d07b8ec8e4b93381f008eba01d448ea281b..2d351d3906cc5f985d43d9b6766ae2b2ab100b90 100644 (file)
@@ -631,7 +631,7 @@ bfd_elf32_bfd_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED,
 
 /* Set the howto pointer for an MSP430 ELF reloc.  */
 
-static void
+static bfd_boolean
 msp430_info_to_howto_rela (bfd * abfd,
                           arelent * cache_ptr,
                           Elf_Internal_Rela * dst)
@@ -647,20 +647,23 @@ msp430_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 = elf_msp430x_howto_table + r_type;
-      return;
     }
-
-  if (r_type >= (unsigned int) R_MSP430_max)
+  else if (r_type >= (unsigned int) R_MSP430_max)
     {
       /* 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 = &elf_msp430_howto_table[r_type];
+  else
+    cache_ptr->howto = &elf_msp430_howto_table[r_type];
+
+  return TRUE;
 }
 
 /* Look through the relocs for a section during the first phase.
This page took 0.024522 seconds and 4 git commands to generate.