X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=bfd%2Felf32-m32c.c;h=e3f03cc045adf70b740dd237f6423a5061991543;hb=d70fc6126f1f495c0c08c335fe4689dd32cf8471;hp=6e7e71ccc8a3a5dcb7e0486da15306eede529e67;hpb=0aa13feeeb78fc9323bee329c4d91c30f25de121;p=deliverable%2Fbinutils-gdb.git diff --git a/bfd/elf32-m32c.c b/bfd/elf32-m32c.c index 6e7e71ccc8..e3f03cc045 100644 --- a/bfd/elf32-m32c.c +++ b/bfd/elf32-m32c.c @@ -1,5 +1,5 @@ /* M16C/M32C specific support for 32-bit ELF. - Copyright (C) 2005-2018 Free Software Foundation, Inc. + Copyright (C) 2005-2019 Free Software Foundation, Inc. This file is part of BFD, the Binary File Descriptor library. @@ -28,7 +28,7 @@ /* Forward declarations. */ static reloc_howto_type * m32c_reloc_type_lookup (bfd *, bfd_reloc_code_real_type); -static void m32c_info_to_howto_rela +static bfd_boolean m32c_info_to_howto_rela (bfd *, arelent *, Elf_Internal_Rela *); static bfd_boolean m32c_elf_relocate_section (bfd *, struct bfd_link_info *, bfd *, asection *, bfd_byte *, Elf_Internal_Rela *, Elf_Internal_Sym *, asection **); @@ -291,10 +291,10 @@ m32c_reloc_name_lookup (bfd *abfd ATTRIBUTE_UNUSED, const char *r_name) /* Set the howto pointer for an M32C ELF reloc. */ -static void -m32c_info_to_howto_rela (bfd *abfd, - arelent *cache_ptr, - Elf_Internal_Rela *dst) +static bfd_boolean +m32c_info_to_howto_rela (bfd * abfd, + arelent * cache_ptr, + Elf_Internal_Rela * dst) { unsigned int r_type; @@ -304,9 +304,11 @@ m32c_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 = & m32c_elf_howto_table [r_type]; + return TRUE; } @@ -448,7 +450,7 @@ m32c_elf_relocate_section name = bfd_elf_string_from_elf_section (input_bfd, symtab_hdr->sh_link, sym->st_name); - name = (sym->st_name == 0) ? bfd_section_name (input_bfd, sec) : name; + name = sym->st_name == 0 ? bfd_section_name (sec) : name; } else { @@ -707,7 +709,7 @@ m32c_elf_check_relocs flags); elf_hash_table (info)->splt = splt; if (splt == NULL - || ! bfd_set_section_alignment (dynobj, splt, 1)) + || !bfd_set_section_alignment (splt, 1)) return FALSE; }