aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-msp430.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-msp430.c')
-rw-r--r--bfd/elf32-msp430.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/bfd/elf32-msp430.c b/bfd/elf32-msp430.c
index 9f2a3d0..2d351d3 100644
--- a/bfd/elf32-msp430.c
+++ b/bfd/elf32-msp430.c
@@ -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.