/* FRV-specific support for 32-bit ELF.
- Copyright (C) 2002-2017 Free Software Foundation, Inc.
+ Copyright (C) 2002-2018 Free Software Foundation, Inc.
This file is part of BFD, the Binary File Descriptor library.
/* Set the howto pointer for an FRV ELF reloc. */
-static void
+static bfd_boolean
frv_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
arelent *cache_ptr,
Elf_Internal_Rela *dst)
if (r_type >= (unsigned int) R_FRV_max)
{
/* xgettext:c-format */
- _bfd_error_handler (_("%B: invalid FRV 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 = & elf32_frv_howto_table [r_type];
break;
}
+ return TRUE;
}
/* Set the howto pointer for an FRV ELF REL reloc. */
-static void
+
+static bfd_boolean
frvfdpic_info_to_howto_rel (bfd *abfd ATTRIBUTE_UNUSED,
arelent *cache_ptr, Elf_Internal_Rela *dst)
{
default:
cache_ptr->howto = NULL;
- break;
+ return FALSE;
}
+ return TRUE;
}
\f
/* Perform a single relocation. By default we use the standard BFD
if (addend)
{
info->callbacks->einfo
- (_("%H: R_FRV_FUNCDESC references dynamic symbol"
+ (_("%H: %s references dynamic symbol"
" with nonzero addend\n"),
- input_bfd, input_section, rel->r_offset);
+ input_bfd, input_section, rel->r_offset,
+ "R_FRV_FUNCDESC");
return FALSE;
}
dynindx = h->dynindx;
if (addend && r_type == R_FRV_FUNCDESC_VALUE)
{
info->callbacks->einfo
- (_("%H: R_FRV_FUNCDESC_VALUE"
- " references dynamic symbol with nonzero addend\n"),
- input_bfd, input_section, rel->r_offset);
+ (_("%H: %s references dynamic symbol"
+ " with nonzero addend\n"),
+ input_bfd, input_section, rel->r_offset,
+ "R_FRV_FUNCDESC_VALUE");
return FALSE;
}
dynindx = h->dynindx;
default:
bad_reloc:
- info->callbacks->einfo
- /* xgettext:c-format */
- (_("%B: unsupported relocation type %i\n"),
- abfd, ELF32_R_TYPE (rel->r_info));
+ /* xgettext:c-format */
+ _bfd_error_handler (_("%pB: unsupported relocation type %#x"),
+ abfd, (unsigned int) ELF32_R_TYPE (rel->r_info));
return FALSE;
}
}
error = TRUE;
_bfd_error_handler
/* xgettext:c-format */
- (_("%B: compiled with %s and linked with modules"
+ (_("%pB: compiled with %s and linked with modules"
" that use non-pic relocations"),
ibfd, (new_flags & EF_FRV_BIGPIC) ? "-fPIC" : "-fpic");
#endif
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 unknown e_flags (%#x) fields"
+ (_("%pB: uses different unknown e_flags (%#x) fields"
" than previous modules (%#x)"),
ibfd, new_partial, old_partial);
}
error = TRUE;
if (IS_FDPIC (obfd))
_bfd_error_handler
- (_("%B: cannot link non-fdpic object file into fdpic executable"),
+ (_("%pB: cannot link non-fdpic object file into fdpic executable"),
ibfd);
else
_bfd_error_handler
- (_("%B: cannot link fdpic object file into non-fdpic executable"),
+ (_("%pB: cannot link fdpic object file into non-fdpic executable"),
ibfd);
}