/* BFD back-end for Renesas Super-H COFF binaries.
- Copyright (C) 1993-2016 Free Software Foundation, Inc.
+ Copyright (C) 1993-2017 Free Software Foundation, Inc.
Contributed by Cygnus Support.
Written by Steve Chamberlain, <sac@cygnus.com>.
Relaxing code written by Ian Lance Taylor, <ian@cygnus.com>.
&& bfd_is_und_section (symbol_in->section))
return bfd_reloc_undefined;
+ if (addr > input_section->size)
+ return bfd_reloc_outofrange;
+
sym_value = get_symbol_value (symbol_in);
switch (r_type)
if (laddr >= sec->size)
{
/* xgettext: c-format */
- _bfd_error_handler (_("%B: 0x%lx: warning: bad R_SH_USES offset"),
- abfd, (unsigned long) irel->r_vaddr);
+ _bfd_error_handler (_("%B: %#Lx: warning: bad R_SH_USES offset"),
+ abfd, irel->r_vaddr);
continue;
}
insn = bfd_get_16 (abfd, contents + laddr);
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%B: 0x%lx: warning: R_SH_USES points to unrecognized insn 0x%x"),
- abfd, (unsigned long) irel->r_vaddr, insn);
+ (_("%B: %#Lx: warning: R_SH_USES points to unrecognized insn %#x"),
+ abfd, irel->r_vaddr, insn);
continue;
}
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%B: 0x%lx: warning: bad R_SH_USES load offset"),
- abfd, (unsigned long) irel->r_vaddr);
+ (_("%B: %#Lx: warning: bad R_SH_USES load offset"),
+ abfd, irel->r_vaddr);
continue;
}
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%B: 0x%lx: warning: could not find expected reloc"),
- abfd, (unsigned long) paddr);
+ (_("%B: %#Lx: warning: could not find expected reloc"),
+ abfd, paddr);
continue;
}
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%B: 0x%lx: warning: symbol in unexpected section"),
- abfd, (unsigned long) paddr);
+ (_("%B: %#Lx: warning: symbol in unexpected section"),
+ abfd, paddr);
continue;
}
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%B: 0x%lx: warning: could not find expected COUNT reloc"),
- abfd, (unsigned long) paddr);
+ (_("%B: %#Lx: warning: could not find expected COUNT reloc"),
+ abfd, paddr);
continue;
}
if (irelcount->r_offset == 0)
{
/* xgettext: c-format */
- _bfd_error_handler (_("%B: 0x%lx: warning: bad count"),
- abfd, (unsigned long) paddr);
+ _bfd_error_handler (_("%B: %#Lx: warning: bad count"),
+ abfd, paddr);
continue;
}
contents = coff_section_data (abfd, sec)->contents;
- /* The deletion must stop at the next ALIGN reloc for an aligment
+ /* The deletion must stop at the next ALIGN reloc for an alignment
power larger than the number of bytes we are deleting. */
irelalign = NULL;
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%B: 0x%lx: fatal: reloc overflow while relaxing"),
- abfd, (unsigned long) irel->r_vaddr);
+ (_("%B: %#Lx: fatal: reloc overflow while relaxing"),
+ abfd, irel->r_vaddr);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
{
_bfd_error_handler
/* xgettext: c-format */
- (_("%B: 0x%lx: fatal: reloc overflow while relaxing"),
- abfd, (unsigned long) irel->r_vaddr);
+ (_("%B: %#Lx: fatal: reloc overflow while relaxing"),
+ abfd, irel->r_vaddr);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}