/* M16C/M32C specific support for 32-bit ELF.
- Copyright (C) 2005-2017 Free Software Foundation, Inc.
+ Copyright (C) 2005-2019 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+ Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
+ MA 02110-1301, USA. */
#include "sysdep.h"
#include "bfd.h"
/* 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 **);
/* Set the howto pointer for an M32C ELF reloc. */
-static void
-m32c_info_to_howto_rela
- (bfd * abfd ATTRIBUTE_UNUSED,
- 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;
if (r_type >= (unsigned int) R_M32C_max)
{
/* xgettext:c-format */
- _bfd_error_handler (_("%B: invalid M32C reloc number: %d"), abfd, r_type);
- r_type = 0;
+ _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+ abfd, r_type);
+ bfd_set_error (bfd_error_bad_value);
+ return FALSE;
}
cache_ptr->howto = & m32c_elf_howto_table [r_type];
+ return TRUE;
}
\f
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
{
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;
}
error = TRUE;
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: compiled with %s and linked with modules compiled with %s"),
+ (_("%pB: compiled with %s and linked with modules compiled with %s"),
ibfd, new_opt, old_opt);
}
error = TRUE;
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: uses different e_flags (%#x) fields"
+ (_("%pB: uses different e_flags (%#x) fields"
" than previous modules (%#x)"),
ibfd, new_flags, old_flags);
}