Elf_Internal_Sym *sym = (Elf_Internal_Sym *)0;
asection *sec = (asection *)0;
struct elf_link_hash_entry *h = (struct elf_link_hash_entry *)0;
+ const char *sym_name = (const char *)0;
reloc_howto_type *howto;
unsigned long r_symndx;
bfd_vma relocation;
{
sym = local_syms + r_symndx;
sec = local_sections[r_symndx];
+ sym_name = "<local symbol>";
+
relocation = (sec->output_section->vma
+ sec->output_offset
+ sym->st_value);
else
{
h = sym_hashes[r_symndx - symtab_hdr->sh_info];
+ sym_name = h->root.root.string;
if (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
{
switch ((int)r_type)
{
default:
- (*_bfd_error_handler) ("%s: unknown relocation type %d",
+ (*_bfd_error_handler) ("%s: unknown relocation type %d for symbol %s",
bfd_get_filename (input_bfd),
- (int)r_type);
+ (int)r_type, sym_name);
bfd_set_error (bfd_error_bad_value);
ret = false;
if (strcmp (bfd_get_section_name (abfd, sec), ".sdata") != 0
&& strcmp (bfd_get_section_name (abfd, sec), ".sbss") != 0)
{
- (*_bfd_error_handler) ("%s: The target of a %s relocation is in the wrong section (%s)",
+ (*_bfd_error_handler) ("%s: The target (%s) of a %s relocation is in the wrong section (%s)",
bfd_get_filename (input_bfd),
+ sym_name,
ppc_elf_howto_table[ (int)r_type ]->name,
bfd_get_section_name (abfd, sec));
if (strcmp (bfd_get_section_name (abfd, sec), ".sdata2") != 0
&& strcmp (bfd_get_section_name (abfd, sec), ".sbss2") != 0)
{
- (*_bfd_error_handler) ("%s: The target of a %s relocation is in the wrong section (%s)",
+ (*_bfd_error_handler) ("%s: The target (%s) of a %s relocation is in the wrong section (%s)",
bfd_get_filename (input_bfd),
+ sym_name,
ppc_elf_howto_table[ (int)r_type ]->name,
bfd_get_section_name (abfd, sec));
else
{
- (*_bfd_error_handler) ("%s: The target of a %s relocation is in the wrong section (%s)",
+ (*_bfd_error_handler) ("%s: The target (%s) of a %s relocation is in the wrong section (%s)",
bfd_get_filename (input_bfd),
+ sym_name,
ppc_elf_howto_table[ (int)r_type ]->name,
bfd_get_section_name (abfd, sec));
case (int)R_PPC_EMB_RELST_HI:
case (int)R_PPC_EMB_RELST_HA:
case (int)R_PPC_EMB_BIT_FLD:
- (*_bfd_error_handler) ("%s: Relocation %s is not yet supported.",
+ (*_bfd_error_handler) ("%s: Relocation %s is not yet supported for symbol %s.",
bfd_get_filename (input_bfd),
- ppc_elf_howto_table[ (int)r_type ]->name);
+ ppc_elf_howto_table[ (int)r_type ]->name,
+ sym_name);
bfd_set_error (bfd_error_invalid_operation);
ret = false;
#ifdef DEBUG
- fprintf (stderr, "\ttype = %s (%d), symbol index = %ld, offset = %ld, addend = %ld\n",
+ fprintf (stderr, "\ttype = %s (%d), name = %s, symbol index = %ld, offset = %ld, addend = %ld\n",
howto->name,
(int)r_type,
+ sym_name,
r_symndx,
(long)offset,
(long)addend);