+2004-10-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR 463
+ * aoutx.h (aout_link_input_section_std): Pass proper hash entry
+ to linker reloc_overflow callback.
+ (aout_link_input_section_ext): Likewise.
+ (aout_link_reloc_link_order): Likewise.
+ * coff-a29k.c (coff_a29k_relocate_section): Likewise.
+ * coff-alpha.c (alpha_ecoff_get_relocated_section_contents):
+ Likewise.
+ (alpha_relocate_section): Likewise.
+ * coff-arm.c (coff_arm_relocate_section): Likewise.
+ * coff-h8300.c (h8300_reloc16_extra_cases): Likewise.
+ * coff-h8500.c (extra_case): Likewise.
+ * coff-i960.c (coff_i960_relocate_section): Likewise.
+ * coff-mcore.c (coff_mcore_relocate_section): Likewise.
+ * coff-mips.c (mips_relocate_section): Likewise.
+ * coff-or32.c (coff_or32_relocate_section): Likewise.
+ * coff-ppc.c (coff_ppc_relocate_section): Likewise.
+ * coff-rs6000.c (xcoff_ppc_relocate_section): Likewise.
+ * coff-sh.c (sh_relocate_section): Likewise.
+ * coff-tic80.c (coff_tic80_relocate_section): Likewise.
+ * coff-w65.c (w65_reloc16_extra_cases): Likewise.
+ * coff-z8k.c (extra_case): Likewise.
+ * coff64-rs6000.c (xcoff64_ppc_relocate_section): Likewise.
+ * cofflink.c (_bfd_coff_reloc_link_order): Likewise.
+ (_bfd_coff_generic_relocate_section): Likewise.
+ * ecoff.c (ecoff_reloc_link_order): Likewise.
+ * elf-hppa.h (elf_hppa_relocate_section): Likewise.
+ * elf-m10200.c (mn10200_elf_relocate_section): Likewise.
+ * elf-m10300.c (mn10300_elf_relocate_section): Likewise.
+ * elf32-arm.h (elf32_arm_relocate_section): Likewise.
+ * elf32-avr.c (elf32_avr_relocate_section): Likewise.
+ * elf32-cr16c.c (elf32_cr16c_relocate_section): Likewise.
+ * elf32-cris.c (cris_elf_relocate_section): Likewise.
+ * elf32-crx.c (elf32_crx_relocate_section): Likewise.
+ * elf32-d10v.c (elf32_d10v_relocate_section): Likewise.
+ * elf32-fr30.c (fr30_elf_relocate_section): Likewise.
+ * elf32-frv.c (elf32_frv_relocate_section): Likewise.
+ * elf32-h8300.c (elf32_h8_relocate_section): Likewise.
+ * elf32-hppa.c (elf32_hppa_relocate_section): Likewise.
+ * elf32-i370.c (i370_elf_relocate_section): Likewise.
+ * elf32-i386.c (elf_i386_relocate_section): Likewise.
+ * elf32-i860.c (elf32_i860_relocate_section): Likewise.
+ * elf32-ip2k.c (ip2k_elf_relocate_section): Likewise.
+ * elf32-iq2000.c (iq2000_elf_relocate_section): Likewise.
+ * elf32-m32r.c (m32r_elf_relocate_section): Likewise.
+ * elf32-m68hc1x.c (elf32_m68hc11_relocate_section): Likewise.
+ * elf32-m68k.c (elf_m68k_relocate_section): Likewise.
+ * elf32-mcore.c (mcore_elf_relocate_section): Likewise.
+ * elf32-msp430.c (elf32_msp430_relocate_section): Likewise.
+ * elf32-openrisc.c (openrisc_elf_relocate_section): Likewise.
+ * elf32-ppc.c (ppc_elf_relocate_section): Likewise.
+ * elf32-s390.c (elf_s390_relocate_section): Likewise.
+ * elf32-sh.c (sh_elf_relocate_section): Likewise.
+ * elf32-sparc.c (elf32_sparc_relocate_section): Likewise.
+ * elf32-v850.c (v850_elf_relocate_section): Likewise.
+ * elf32-vax.c (elf_vax_relocate_section): Likewise.
+ * elf32-xstormy16.c (xstormy16_elf_relocate_section): Likewise.
+ * elf64-alpha.c (elf64_alpha_relocate_section): Likewise.
+ * elf64-mmix.c (mmix_elf_relocate_section): Likewise.
+ * elf64-ppc.c (ppc64_elf_relocate_section): Likewise.
+ * elf64-s390.c (elf_s390_relocate_section): Likewise.
+ * elf64-sh64.c (sh_elf64_relocate_section): Likewise.
+ * elf64-sparc.c (sparc64_elf_relocate_section): Likewise.
+ * elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
+ * elflink.c (elf_reloc_link_order): Likewise.
+ * elfxx-ia64.c (elfNN_ia64_relocate_section): Likewise.
+ * elfxx-mips.c (_bfd_mips_elf_relocate_section): Likewise.
+ (_bfd_elf_mips_get_relocated_section_contents): Likewise.
+ * linker.c (_bfd_generic_reloc_link_order): Likewise.
+ * pdp11.c (pdp11_aout_link_input_section): Likewise.
+ (aout_link_reloc_link_order): Likewise.
+ * reloc.c (bfd_generic_get_relocated_section_contents):
+ Likewise.
+ * xcofflink.c (xcoff_reloc_link_order): Likewise.
+ * simple.c (simple_dummy_reloc_overflow): Updated.
+
2004-10-20 Andreas Schwab <schwab@suse.de>
* elf32-m68k.c (elf_m68k_plt_sym_val): New function.
const char *name;
if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else if (r_extern)
name = strings + GET_WORD (input_bfd,
syms[r_index].e_strx);
name = bfd_section_name (input_bfd, s);
}
if (! ((*finfo->info->callbacks->reloc_overflow)
- (finfo->info, name, howto->name,
- (bfd_vma) 0, input_bfd, input_section, r_addr)))
+ (finfo->info, (h ? &h->root : NULL), name,
+ howto->name, (bfd_vma) 0, input_bfd,
+ input_section, r_addr)))
return FALSE;
}
break;
const char *name;
if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else if (r_extern
|| r_type == (unsigned int) RELOC_BASE10
|| r_type == (unsigned int) RELOC_BASE13
name = bfd_section_name (input_bfd, s);
}
if (! ((*finfo->info->callbacks->reloc_overflow)
- (finfo->info, name, howto_table_ext[r_type].name,
+ (finfo->info, (h ? &h->root : NULL), name,
+ howto_table_ext[r_type].name,
r_addend, input_bfd, input_section, r_addr)))
return FALSE;
}
abort ();
case bfd_reloc_overflow:
if (! ((*finfo->info->callbacks->reloc_overflow)
- (finfo->info,
+ (finfo->info, NULL,
(p->type == bfd_section_reloc_link_order
? bfd_section_name (finfo->output_bfd,
pr->u.section)
if (symndx == -1)
name = "*ABS*";
else if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else if (sym == NULL)
name = "*unknown*";
else if (sym->_n._n_n._n_zeroes == 0
}
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto_table[rel->r_type].name, (bfd_vma) 0,
- input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ (info, (h ? &h->root : NULL), name,
+ howto_table[rel->r_type].name, (bfd_vma) 0, input_bfd,
+ input_section, rel->r_vaddr - input_section->vma)))
return FALSE;
}
}
break;
case bfd_reloc_overflow:
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*rel->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*rel->sym_ptr_ptr),
rel->howto->name, rel->addend, input_bfd,
input_section, rel->address)))
goto error_return;
name = bfd_section_name (input_bfd,
symndx_to_section[r_symndx]);
if (! ((*info->callbacks->reloc_overflow)
- (info, name, alpha_howto_table[r_type].name,
+ (info, NULL, name,
+ alpha_howto_table[r_type].name,
(bfd_vma) 0, input_bfd, input_section,
r_vaddr - input_section->vma)))
return FALSE;
if (symndx == -1)
name = "*ABS*";
else if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else
{
name = _bfd_coff_internal_syment_name (input_bfd, sym, buf);
}
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0, input_bfd,
- input_section, rel->r_vaddr - input_section->vma)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_vaddr - input_section->vma)))
return FALSE;
}
}
if (gap < -128 || gap > 126)
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
if (gap > 32766 || gap < -32768)
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
else
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
if (gap < -128 || gap > 126)
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
if (gap < -128 || gap > 126)
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
if (gap < -128 || gap > 126)
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
else
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
if (gap > 128 || gap < -128)
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
if (gap > 32767 || gap < -32768)
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
if (symndx == -1)
name = "*ABS*";
else if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else
{
name = _bfd_coff_internal_syment_name (input_bfd, sym, buf);
}
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0, input_bfd,
- input_section, rel->r_vaddr - input_section->vma)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_vaddr - input_section->vma)))
return FALSE;
}
}
case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow)
- (info, my_name, howto->name,
+ (info, (h ? &h->root : NULL), my_name, howto->name,
(bfd_vma) 0, input_bfd,
input_section, rel->r_vaddr - input_section->vma)))
return FALSE;
const char *name;
if (int_rel.r_extern)
- name = h->root.root.string;
+ name = NULL;
else
name = bfd_section_name (input_bfd, s);
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section,
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
int_rel.r_vaddr - input_section->vma)))
return FALSE;
}
if (symndx == -1)
name = "*ABS*";
else if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else if (sym == NULL)
name = "*unknown*";
else if (sym->_n._n_n._n_zeroes == 0
}
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto_table[rel->r_type].name, (bfd_vma) 0,
- input_bfd, input_section,
- rel->r_vaddr - input_section->vma)))
+ (info, (h ? &h->root : NULL), name,
+ howto_table[rel->r_type].name, (bfd_vma) 0, input_bfd,
+ input_section, rel->r_vaddr - input_section->vma)))
return FALSE;
}
}
if (symndx == -1)
name = "*ABS*";
else if (h != NULL)
- name = h->root.root.root.string;
+ name = NULL;
else if (sym == NULL)
name = "*unknown*";
else if (sym->_n._n_n._n_zeroes == 0
}
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name,
+ (info, (h ? &h->root.root : NULL), name, howto->name,
(bfd_vma) 0, input_bfd,
input_section, rel->r_vaddr - input_section->vma)))
return FALSE;
}
else if (h != NULL)
{
- name = h->root.root.string;
+ name = NULL;
}
else
{
sprintf (reloc_type_name, "0x%02x", rel->r_type);
if (! ((*info->callbacks->reloc_overflow)
- (info, name, reloc_type_name, (bfd_vma) 0, input_bfd,
- input_section, rel->r_vaddr - input_section->vma)))
+ (info, (h ? &h->root : NULL), name, reloc_type_name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_vaddr - input_section->vma)))
return FALSE;
}
if (symndx == -1)
name = "*ABS*";
else if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else if (sym->_n._n_n._n_zeroes == 0
&& sym->_n._n_n._n_offset != 0)
name = obj_coff_strings (input_bfd) + sym->_n._n_n._n_offset;
}
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0, input_bfd,
- input_section, rel->r_vaddr - input_section->vma)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_vaddr - input_section->vma)))
return FALSE;
}
}
if (symndx == -1)
name = "*ABS*";
else if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else
{
name = _bfd_coff_internal_syment_name (input_bfd, sym, buf);
}
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0, input_bfd,
- input_section, rel->r_vaddr - input_section->vma)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_vaddr - input_section->vma)))
return FALSE;
}
}
if (gap < -128 || gap > 127)
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
if ((gap & 0xf0000) != (dot & 0xf0000))
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
if (gap > 128 || gap < -128)
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
if (gap > 0 || gap < -127)
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
if (gap > 4096 || gap < -4095)
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
if (gap > 32767 || gap < -32768)
{
if (! ((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*reloc->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*reloc->sym_ptr_ptr),
reloc->howto->name, reloc->addend, input_section->owner,
input_section, reloc->address)))
abort ();
}
else if (h != NULL)
{
- name = h->root.root.string;
+ name = NULL;
}
else
{
sprintf (reloc_type_name, "0x%02x", rel->r_type);
if (! ((*info->callbacks->reloc_overflow)
- (info, name, reloc_type_name, (bfd_vma) 0, input_bfd,
- input_section, rel->r_vaddr - input_section->vma)))
+ (info, (h ? &h->root : NULL), name, reloc_type_name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_vaddr - input_section->vma)))
return FALSE;
}
abort ();
case bfd_reloc_overflow:
if (! ((*finfo->info->callbacks->reloc_overflow)
- (finfo->info,
+ (finfo->info, NULL,
(link_order->type == bfd_section_reloc_link_order
? bfd_section_name (output_bfd,
link_order->u.reloc.p->u.section)
if (symndx == -1)
name = "*ABS*";
else if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else
{
name = _bfd_coff_internal_syment_name (input_bfd, sym, buf);
}
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0, input_bfd,
- input_section, rel->r_vaddr - input_section->vma)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_vaddr - input_section->vma)))
return FALSE;
}
}
abort ();
case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow)
- (info,
+ (info, NULL,
(link_order->type == bfd_section_reloc_link_order
? bfd_section_name (output_bfd, section)
: link_order->u.reloc.p->u.name),
asection *sym_sec;
bfd_vma relocation;
bfd_reloc_status_type r;
- const char *sym_name;
const char *dyn_name;
char *dynh_buf = NULL;
size_t dynh_buflen = 0;
}
}
- if (h != NULL)
- sym_name = h->root.root.string;
- else
- {
- sym_name = bfd_elf_string_from_elf_section (input_bfd,
- symtab_hdr->sh_link,
- sym->st_name);
- if (sym_name == NULL)
- return FALSE;
- if (*sym_name == '\0')
- sym_name = bfd_section_name (input_bfd, sym_sec);
- }
-
r = elf_hppa_final_link_relocate (rel, input_bfd, output_bfd,
input_section, contents,
relocation, info, sym_sec,
abort ();
case bfd_reloc_overflow:
{
+ const char *sym_name;
+
+ if (h != NULL)
+ sym_name = NULL;
+ else
+ {
+ sym_name = bfd_elf_string_from_elf_section (input_bfd,
+ symtab_hdr->sh_link,
+ sym->st_name);
+ if (sym_name == NULL)
+ return FALSE;
+ if (*sym_name == '\0')
+ sym_name = bfd_section_name (input_bfd, sym_sec);
+ }
+
if (!((*info->callbacks->reloc_overflow)
- (info, sym_name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), sym_name,
+ howto->name, (bfd_vma) 0, input_bfd,
+ input_section, rel->r_offset)))
return FALSE;
}
break;
{
case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
break;
{
case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root.root : NULL), name,
+ howto->name, (bfd_vma) 0, input_bfd,
+ input_section, rel->r_offset)))
return FALSE;
break;
if ((! h ||
h->root.type != bfd_link_hash_undefined)
&& (!((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset))))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset))))
return FALSE;
break;
struct elf_link_hash_entry * h;
bfd_vma relocation;
bfd_reloc_status_type r;
- const char * name = NULL;
+ const char * name;
int r_type;
/* This is a final link. */
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
unresolved_reloc, warned);
+
+ name = h->root.root.string;
}
r = avr_final_link_relocate (howto, input_bfd, input_section,
{
case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow
- (info, name, howto->name, (bfd_vma) 0,
+ (info, (h ? &h->root : NULL),
+ name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset);
break;
{
case bfd_reloc_overflow:
if (!((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
break;
{
case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow
- (info, symname, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset);
+ (info, (h ? &h->root : NULL), symname, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break;
case bfd_reloc_undefined:
{
case bfd_reloc_overflow:
if (!((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
break;
{
case bfd_reloc_overflow:
if (!((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
break;
struct elf_link_hash_entry *h;
bfd_vma relocation;
bfd_reloc_status_type r;
- const char *name = NULL;
+ const char *name;
int r_type;
r_type = ELF32_R_TYPE (rel->r_info);
r_symndx, symtab_hdr, sym_hashes,
h, sec, relocation,
unresolved_reloc, warned);
+
+ name = h->root.root.string;
}
r = fr30_final_link_relocate (howto, input_bfd, input_section,
{
case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset);
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break;
case bfd_reloc_undefined:
{
case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset);
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break;
case bfd_reloc_undefined:
{
case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
break;
else
{
if (!((*info->callbacks->reloc_overflow)
- (info, sym_name, howto->name, 0, input_bfd, input_section,
- rel->r_offset)))
+ (info, (h ? &h->elf.root : NULL), sym_name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset)))
return FALSE;
}
}
const char *name;
if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else
{
name = bfd_elf_string_from_elf_section (input_bfd,
}
(*info->callbacks->reloc_overflow) (info,
+ (h ? &h->root : NULL),
name,
howto->name,
(bfd_vma) 0,
if (r == bfd_reloc_overflow)
{
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
}
else
{
case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset);
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break;
case bfd_reloc_undefined:
{
case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset);
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break;
case bfd_reloc_undefined:
{
case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset);
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break;
case bfd_reloc_undefined:
{
case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, offset)))
return FALSE;
break;
{
case bfd_reloc_overflow:
if (!((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
+ (info, NULL, name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset)))
return FALSE;
break;
if (r == bfd_reloc_overflow)
{
if (!(info->callbacks->reloc_overflow
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
}
else
const char * name;
if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else
{
name = bfd_elf_string_from_elf_section
}
(*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0, input_bfd, input_section,
- offset);
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, offset);
}
break;
}
{
case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset);
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset);
break;
case bfd_reloc_undefined:
{
case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset);
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break;
case bfd_reloc_undefined:
}
if (! (*info->callbacks->reloc_overflow) (info,
+ (h ? &h->root : NULL),
sym_name,
howto->name,
rel->r_addend,
{
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
}
else
const char *name;
if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else
{
name = (bfd_elf_string_from_elf_section
name = bfd_section_name (input_bfd, sec);
}
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
}
break;
const char *name;
if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else
{
name = bfd_elf_string_from_elf_section (input_bfd,
name = bfd_section_name (input_bfd, sec);
}
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
}
break;
{
case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
break;
const char *name;
if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else
{
name = bfd_elf_string_from_elf_section (input_bfd,
name = bfd_section_name (input_bfd, sec);
}
if (!(info->callbacks->reloc_overflow
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
}
break;
{
case bfd_reloc_overflow:
r = info->callbacks->reloc_overflow
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset);
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break;
case bfd_reloc_undefined:
break;
if (h != NULL)
- name = h->root.root.root.string;
+ name = NULL;
else
{
name = (bfd_elf_string_from_elf_section
name = bfd_section_name (input_bfd, sec);
}
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root.root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
ret_val = FALSE;
}
break;
{
case bfd_reloc_overflow:
check_ok = info->callbacks->reloc_overflow
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset);
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section, rel->r_offset);
break;
case bfd_reloc_undefined:
}
if (!((*info->callbacks->reloc_overflow)
- (info, sym_name, ppc64_elf_howto_table[r_type]->name,
+ (info, (h ? &h->elf.root : NULL), sym_name,
+ ppc64_elf_howto_table[r_type]->name,
rel->r_addend, input_bfd, input_section, rel->r_offset)))
return FALSE;
}
{
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
}
else
const char *name;
if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else
{
name = (bfd_elf_string_from_elf_section
name = bfd_section_name (input_bfd, sec);
}
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
}
break;
break;
}
- name = h->root.root.string;
+ name = NULL;
}
else
{
name = bfd_section_name (input_bfd, sec);
}
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
}
break;
continue;
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, (bfd_vma) 0,
- input_bfd, input_section, rel->r_offset)))
+ (info, (h ? &h->root : NULL), name, howto->name,
+ (bfd_vma) 0, input_bfd, input_section,
+ rel->r_offset)))
return FALSE;
}
else
else
sym_name = link_order->u.reloc.p->u.name;
if (! ((*info->callbacks->reloc_overflow)
- (info, sym_name, howto->name, addend, NULL, NULL, 0)))
+ (info, NULL, sym_name, howto->name, addend, NULL,
+ NULL, (bfd_vma) 0)))
{
free (buf);
return FALSE;
const char *name;
if (h)
- name = h->root.root.string;
+ name = NULL;
else
{
name = bfd_elf_string_from_elf_section (input_bfd,
if (name == NULL)
return FALSE;
if (*name == '\0')
- name = bfd_section_name (input_bfd, input_section);
+ name = bfd_section_name (input_bfd, sym_sec);
}
- if (!(*info->callbacks->reloc_overflow) (info, name,
- howto->name,
+ if (!(*info->callbacks->reloc_overflow) (info, &h->root,
+ name, howto->name,
(bfd_vma) 0,
input_bfd,
input_section,
{
BFD_ASSERT (name != NULL);
if (! ((*info->callbacks->reloc_overflow)
- (info, name, howto->name, 0,
+ (info, NULL, name, howto->name, (bfd_vma) 0,
input_bfd, input_section, rel->r_offset)))
return FALSE;
}
break;
case bfd_reloc_overflow:
if (!((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
(*parent)->howto->name, (*parent)->addend,
input_bfd, input_section, (*parent)->address)))
goto error_return;
abort ();
case bfd_reloc_overflow:
if (! ((*info->callbacks->reloc_overflow)
- (info,
+ (info, NULL,
(link_order->type == bfd_section_reloc_link_order
? bfd_section_name (abfd, link_order->u.reloc.p->u.section)
: link_order->u.reloc.p->u.name),
const char *name;
if (h != NULL)
- name = h->root.root.string;
+ name = NULL;
else if (r_extern)
name = strings + GET_WORD (input_bfd,
syms[r_index].e_strx);
name = bfd_section_name (input_bfd, s);
}
if (! ((*finfo->info->callbacks->reloc_overflow)
- (finfo->info, name, howto->name,
- (bfd_vma) 0, input_bfd, input_section, r_addr)))
+ (finfo->info, (h ? &h->root : NULL), name,
+ howto->name, (bfd_vma) 0, input_bfd,
+ input_section, r_addr)))
return FALSE;
}
break;
abort ();
case bfd_reloc_overflow:
if (! ((*finfo->info->callbacks->reloc_overflow)
- (finfo->info,
+ (finfo->info, NULL,
(p->type == bfd_section_reloc_link_order
? bfd_section_name (finfo->output_bfd,
pr->u.section)
break;
case bfd_reloc_overflow:
if (!((*link_info->callbacks->reloc_overflow)
- (link_info, bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
+ (link_info, NULL,
+ bfd_asymbol_name (*(*parent)->sym_ptr_ptr),
(*parent)->howto->name, (*parent)->addend,
input_bfd, input_section, (*parent)->address)))
goto error_return;
static bfd_boolean
simple_dummy_reloc_overflow (struct bfd_link_info *link_info ATTRIBUTE_UNUSED,
+ struct bfd_link_hash_entry *entry ATTRIBUTE_UNUSED,
const char *name ATTRIBUTE_UNUSED,
const char *reloc_name ATTRIBUTE_UNUSED,
bfd_vma addend ATTRIBUTE_UNUSED,
abort ();
case bfd_reloc_overflow:
if (! ((*finfo->info->callbacks->reloc_overflow)
- (finfo->info, link_order->u.reloc.p->u.name,
+ (finfo->info, NULL, link_order->u.reloc.p->u.name,
howto->name, addend, (bfd *) NULL, (asection *) NULL,
(bfd_vma) 0)))
{
+2004-10-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR 463
+ * bfdlink.h (bfd_link_callbacks): Add a pointer to struct
+ bfd_link_hash_entry to reloc_overflow.
+
2004-10-12 Paul Brook <paul@codesourcery.com>
* elf/arm.h (EF_ARM_EABI_VER4): Define.
bfd_boolean (*undefined_symbol)
(struct bfd_link_info *, const char *name, bfd *abfd,
asection *section, bfd_vma address, bfd_boolean fatal);
- /* A function which is called when a reloc overflow occurs. NAME is
- the name of the symbol or section the reloc is against,
- RELOC_NAME is the name of the relocation, and ADDEND is any
- addend that is used. ABFD, SECTION and ADDRESS identify the
+ /* A function which is called when a reloc overflow occurs. ENTRY is
+ the link hash table entry for the symbol the reloc is against.
+ NAME is the name of the local symbol or section the reloc is
+ against, RELOC_NAME is the name of the relocation, and ADDEND is
+ any addend that is used. ABFD, SECTION and ADDRESS identify the
location at which the overflow occurs; if this is the result of a
bfd_section_reloc_link_order or bfd_symbol_reloc_link_order, then
ABFD will be NULL. */
bfd_boolean (*reloc_overflow)
- (struct bfd_link_info *, const char *name, const char *reloc_name,
- bfd_vma addend, bfd *abfd, asection *section, bfd_vma address);
+ (struct bfd_link_info *, struct bfd_link_hash_entry *entry,
+ const char *name, const char *reloc_name, bfd_vma addend,
+ bfd *abfd, asection *section, bfd_vma address);
/* A function which is called when a dangerous reloc is performed.
The canonical example is an a29k IHCONST reloc which does not
follow an IHIHALF reloc. MESSAGE is an appropriate message.
+2004-10-21 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR 463
+ * ldmain.c (reloc_overflow): Accept a pointer to struct
+ bfd_link_hash_entry. Report symbol location for relocation
+ overflow.
+
2004-10-21 H.J. Lu <hongjiu.lu@intel.com>
* genscripts.sh (libpath.exp): Really generate for first
(struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma,
bfd_boolean);
static bfd_boolean reloc_overflow
- (struct bfd_link_info *, const char *, const char *, bfd_vma,
- bfd *, asection *, bfd_vma);
+ (struct bfd_link_info *, struct bfd_link_hash_entry *, const char *,
+ const char *, bfd_vma, bfd *, asection *, bfd_vma);
static bfd_boolean reloc_dangerous
(struct bfd_link_info *, const char *, bfd *, asection *, bfd_vma);
static bfd_boolean unattached_reloc
static bfd_boolean
reloc_overflow (struct bfd_link_info *info ATTRIBUTE_UNUSED,
+ struct bfd_link_hash_entry *entry,
const char *name,
const char *reloc_name,
bfd_vma addend,
return TRUE;
}
- einfo (_(" relocation truncated to fit: %s %T"), reloc_name, name);
+ if (entry)
+ {
+ while (entry->type == bfd_link_hash_indirect
+ || entry->type == bfd_link_hash_warning)
+ entry = entry->u.i.link;
+ switch (entry->type)
+ {
+ case bfd_link_hash_undefined:
+ case bfd_link_hash_undefweak:
+ einfo (_(" relocation truncated to fit: %s against undefined symbol `%T'"),
+ reloc_name, entry->root.string);
+ break;
+ case bfd_link_hash_defined:
+ case bfd_link_hash_defweak:
+ einfo (_(" relocation truncated to fit: %s against symbol `%T' defined in %A section in %B"),
+ reloc_name, entry->root.string,
+ entry->u.def.section, entry->u.def.section->owner);
+ break;
+ default:
+ abort ();
+ break;
+ }
+ }
+ else
+ einfo (_(" relocation truncated to fit: %s against `%T'"),
+ reloc_name, name);
if (addend != 0)
einfo ("+%v", addend);
einfo ("\n");