break;
}
+ /* xgettext:c-format */
+ _bfd_error_handler (_("%pB: unsupported relocation type %#x"), abfd, (int) code);
+ bfd_set_error (bfd_error_bad_value);
TRACE ("Unknown");
return NULL;
}
/* Given an ELF "rela" relocation, find the corresponding howto and record
it in the BFD internal arelent representation of the relocation. */
-static void
-elf_xtensa_info_to_howto_rela (bfd *abfd ATTRIBUTE_UNUSED,
+static bfd_boolean
+elf_xtensa_info_to_howto_rela (bfd *abfd,
arelent *cache_ptr,
Elf_Internal_Rela *dst)
{
if (r_type >= (unsigned int) R_XTENSA_max)
{
/* xgettext:c-format */
- _bfd_error_handler (_("%pB: invalid XTENSA 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 = &elf_howto_table[r_type];
+ return TRUE;
}
\f
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB(%pA+%#Lx): relocation offset out of range (size=%#Lx)"),
- input_bfd, input_section, rel->r_offset, input_size);
+ (_("%pB(%pA+%#" PRIx64 "): "
+ "relocation offset out of range (size=%#" PRIx64 ")"),
+ input_bfd, input_section, (uint64_t) rel->r_offset,
+ (uint64_t) input_size);
bfd_set_error (bfd_error_bad_value);
return FALSE;
}
_bfd_error_handler
((sym_type == STT_TLS
/* xgettext:c-format */
- ? _("%pB(%pA+%#Lx): %s used with TLS symbol %s")
+ ? _("%pB(%pA+%#" PRIx64 "): %s used with TLS symbol %s")
/* xgettext:c-format */
- : _("%pB(%pA+%#Lx): %s used with non-TLS symbol %s")),
+ : _("%pB(%pA+%#" PRIx64 "): %s used with non-TLS symbol %s")),
input_bfd,
input_section,
- rel->r_offset,
+ (uint64_t) rel->r_offset,
howto->name,
name);
}
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB(%pA+%#Lx): unresolvable %s relocation against symbol `%s'"),
+ (_("%pB(%pA+%#" PRIx64 "): "
+ "unresolvable %s relocation against symbol `%s'"),
input_bfd,
input_section,
- rel->r_offset,
+ (uint64_t) rel->r_offset,
howto->name,
name);
return FALSE;
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB: incompatible machine type. Output is 0x%x. Input is 0x%x"),
+ (_("%pB: incompatible machine type; output is 0x%x; input is 0x%x"),
ibfd, out_mach, in_mach);
bfd_set_error (bfd_error_wrong_format);
return FALSE;
if (content_length < address)
{
- *error_message = _("Attempt to convert L32R/CALLX to CALL failed");
+ *error_message = _("attempt to convert L32R/CALLX to CALL failed");
return bfd_reloc_other;
}
direct_call_opcode = swap_callx_for_call_opcode (opcode);
if (direct_call_opcode == XTENSA_UNDEFINED)
{
- *error_message = _("Attempt to convert L32R/CALLX to CALL failed");
+ *error_message = _("attempt to convert L32R/CALLX to CALL failed");
return bfd_reloc_other;
}
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB(%pA+%#Lx): could not decode instruction; "
+ (_("%pB(%pA+%#" PRIx64 "): could not decode instruction; "
"possible configuration mismatch"),
- ebb->sec->owner, ebb->sec, ebb->end_offset + insn_block_len);
+ ebb->sec->owner, ebb->sec,
+ (uint64_t) (ebb->end_offset + insn_block_len));
return FALSE;
}
ebb->end_offset += insn_block_len;
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB(%pA+%#Lx): could not decode instruction; "
+ (_("%pB(%pA+%#" PRIx64 "): could not decode instruction; "
"possible configuration mismatch"),
- ebb->sec->owner, ebb->sec, ebb->end_offset + insn_block_len);
+ ebb->sec->owner, ebb->sec,
+ (uint64_t) (ebb->end_offset + insn_block_len));
return FALSE;
}
ebb->start_offset -= insn_block_len;
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB(%pA+%#Lx): could not decode instruction for "
+ (_("%pB(%pA+%#" PRIx64 "): could not decode instruction for "
"XTENSA_ASM_SIMPLIFY relocation; "
"possible configuration mismatch"),
- sec->owner, sec, r_offset);
+ sec->owner, sec, (uint64_t) r_offset);
continue;
}
decode_error:
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB(%pA+%#Lx): could not decode instruction; "
+ (_("%pB(%pA+%#" PRIx64 "): could not decode instruction; "
"possible configuration mismatch"),
- ebb->sec->owner, ebb->sec, offset);
+ ebb->sec->owner, ebb->sec, (uint64_t) offset);
return FALSE;
}
struct xlate_map_entry
{
- unsigned orig_address;
- unsigned new_address;
+ bfd_vma orig_address;
+ bfd_vma new_address;
unsigned size;
};
{
void *r;
xlate_map_entry_t *e;
+ struct xlate_map_entry se;
if (map == NULL)
return offset_with_removed_text (action_list, offset);
if (map->entry_count == 0)
return offset;
- r = bsearch (&offset, map->entry, map->entry_count,
+ se.orig_address = offset;
+ r = bsearch (&se, map->entry, map->entry_count,
sizeof (xlate_map_entry_t), &xlate_compare);
e = (xlate_map_entry_t *) r;
+ /* There could be a jump past the end of the section,
+ allow it using the last xlate map entry to translate its address. */
+ if (e == NULL)
+ {
+ e = map->entry + map->entry_count - 1;
+ if (xlate_compare (&se, e) <= 0)
+ e = NULL;
+ }
BFD_ASSERT (e != NULL);
if (e == NULL)
return offset;
{
_bfd_error_handler
/* xgettext:c-format */
- (_("%pB(%pA+%#Lx): unexpected fix for %s relocation"),
- input_bfd, input_section, rel->r_offset,
+ (_("%pB(%pA+%#" PRIx64 "): unexpected fix for %s relocation"),
+ input_bfd, input_section, (uint64_t) rel->r_offset,
elf_howto_table[r_type].name);
return FALSE;
}