This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR 463: Relocation overflow message should be more informational


On Thu, Oct 21, 2004 at 12:22:45PM +0930, Alan Modra wrote:
> On Wed, Oct 20, 2004 at 04:43:02PM -0700, H. J. Lu wrote:
> > @@ -1408,7 +1409,43 @@ reloc_overflow (struct bfd_link_info *in
> >        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;
> 
> You obviously didn't test this..  %A and %B are a little tricky.

I did. It worked as expected:

foo.c: relocation truncated to fit: GPREL22 against symbol `bar' defined in .bss section in libx.a(x.o)

_bfd_default_error_handler expects %A and %B before others. But they
are normal for vfinfo.

> 
> > +	case bfd_link_hash_common:
> > +	  einfo (_(" relocation truncated to fit: %s against common symbol `%T' in %A section in %B"),
> > +		 reloc_name, entry->root.string,
> > +		 entry->u.c.p->section, entry->u.c.p->section->owner);
> > +	  break;
> 
> There is no need to handle bfd_link_hash_common.  At the time this
> function might be called, all common syms will have been converted to
> bfd_link_hash_defined.
> 
> > +	default:
> > +	  einfo (_(" relocation truncated to fit: %s against unknown symbol `%T'"),
> > +		 reloc_name, entry->root.string);
> > +	  break;
> 
> This should just be an abort.
> 
> > +	}
> > +    }
> > +  else
> > +    {
> > +      if (name && *name != '\0')
> > +	einfo (_(" relocation truncated to fit: %s against `%T'"),
> > +	       reloc_name, name);
> > +      else
> > +	einfo (_(" relocation truncated to fit: %s"), reloc_name);
> 
> I'd leave this to be handled by %T.  A null name will print as
> "no symbol", which I think is better than omitting the name.

Here is a new patch.


H.J.
---
bfd/

2004-10-20  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.

include/

2004-10-20  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.

ld/

2004-10-20  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.

--- binutils/bfd/aoutx.h.overflow	2004-06-28 08:57:37.000000000 -0700
+++ binutils/bfd/aoutx.h	2004-10-20 17:08:31.670845285 -0700
@@ -5158,7 +5158,7 @@ aout_link_input_section_std (finfo, inpu
 		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);
@@ -5170,8 +5170,9 @@ aout_link_input_section_std (finfo, inpu
 		    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;
@@ -5569,7 +5570,7 @@ aout_link_input_section_ext (finfo, inpu
 		    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
@@ -5584,7 +5585,8 @@ aout_link_input_section_ext (finfo, inpu
 			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;
 		  }
@@ -5753,7 +5755,7 @@ aout_link_reloc_link_order (finfo, o, p)
 	      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)
--- binutils/bfd/coff-a29k.c.overflow	2003-06-26 07:34:46.000000000 -0700
+++ binutils/bfd/coff-a29k.c	2004-10-20 17:08:31.672845026 -0700
@@ -532,7 +532,7 @@ coff_a29k_relocate_section (output_bfd, 
 	  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
@@ -546,9 +546,9 @@ coff_a29k_relocate_section (output_bfd, 
 	    }
 
 	  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;
 	}
     }
--- binutils/bfd/coff-alpha.c.overflow	2004-07-21 08:57:25.000000000 -0700
+++ binutils/bfd/coff-alpha.c	2004-10-20 17:08:31.676844509 -0700
@@ -1145,7 +1145,8 @@ alpha_ecoff_get_relocated_section_conten
 	      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;
@@ -1960,7 +1961,8 @@ alpha_relocate_section (output_bfd, info
 		      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;
--- binutils/bfd/coff-arm.c.overflow	2004-08-13 08:00:04.000000000 -0700
+++ binutils/bfd/coff-arm.c	2004-10-20 17:08:31.680843992 -0700
@@ -1795,7 +1795,7 @@ coff_arm_relocate_section (output_bfd, i
 	    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);
@@ -1804,8 +1804,9 @@ coff_arm_relocate_section (output_bfd, i
 	      }
 
 	    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;
 	  }
 	}
--- binutils/bfd/coff-h8300.c.overflow	2004-06-24 08:29:16.000000000 -0700
+++ binutils/bfd/coff-h8300.c	2004-10-20 17:08:31.683843604 -0700
@@ -685,7 +685,8 @@ h8300_reloc16_extra_cases (bfd *abfd, st
       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 ();
@@ -716,7 +717,8 @@ h8300_reloc16_extra_cases (bfd *abfd, st
       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 ();
@@ -805,7 +807,8 @@ h8300_reloc16_extra_cases (bfd *abfd, st
       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 ();
@@ -828,7 +831,8 @@ h8300_reloc16_extra_cases (bfd *abfd, st
       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 ();
@@ -874,7 +878,8 @@ h8300_reloc16_extra_cases (bfd *abfd, st
       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 ();
@@ -1073,7 +1078,8 @@ h8300_reloc16_extra_cases (bfd *abfd, st
       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 ();
@@ -1155,7 +1161,8 @@ h8300_reloc16_extra_cases (bfd *abfd, st
 	    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 ();
--- binutils/bfd/coff-h8500.c.overflow	2003-06-04 07:30:52.000000000 -0700
+++ binutils/bfd/coff-h8500.c	2004-10-20 17:08:31.684843475 -0700
@@ -254,7 +254,8 @@ extra_case (in_abfd, link_info, link_ord
 	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 ();
@@ -277,7 +278,8 @@ extra_case (in_abfd, link_info, link_ord
 	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 ();
--- binutils/bfd/coff-i960.c.overflow	2003-06-26 07:34:46.000000000 -0700
+++ binutils/bfd/coff-i960.c	2004-10-20 17:08:31.686843216 -0700
@@ -555,7 +555,7 @@ coff_i960_relocate_section (output_bfd, 
 	    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);
@@ -564,8 +564,9 @@ coff_i960_relocate_section (output_bfd, 
 	      }
 
 	    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;
 	  }
 	}
--- binutils/bfd/coff-mcore.c.overflow	2004-08-13 08:00:04.000000000 -0700
+++ binutils/bfd/coff-mcore.c	2004-10-20 17:08:31.688842958 -0700
@@ -556,7 +556,7 @@ coff_mcore_relocate_section (output_bfd,
 
 	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;
--- binutils/bfd/coff-mips.c.overflow	2004-07-21 08:57:27.000000000 -0700
+++ binutils/bfd/coff-mips.c	2004-10-20 17:08:31.690842699 -0700
@@ -1261,12 +1261,12 @@ mips_relocate_section (output_bfd, info,
 		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;
 	      }
--- binutils/bfd/coff-or32.c.overflow	2003-06-26 07:34:46.000000000 -0700
+++ binutils/bfd/coff-or32.c	2004-10-20 17:08:31.692842441 -0700
@@ -545,7 +545,7 @@ coff_or32_relocate_section (output_bfd, 
           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
@@ -559,9 +559,9 @@ coff_or32_relocate_section (output_bfd, 
             }
 
           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;
         }
     }
--- binutils/bfd/coff-ppc.c.overflow	2004-08-13 08:00:04.000000000 -0700
+++ binutils/bfd/coff-ppc.c	2004-10-20 17:08:31.696841924 -0700
@@ -1563,7 +1563,7 @@ coff_ppc_relocate_section (output_bfd, i
 	    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
@@ -1577,7 +1577,7 @@ coff_ppc_relocate_section (output_bfd, i
 	      }
 
 	    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;
--- binutils/bfd/coff-rs6000.c.overflow	2004-10-11 09:35:19.000000000 -0700
+++ binutils/bfd/coff-rs6000.c	2004-10-20 17:08:31.700841406 -0700
@@ -3481,7 +3481,7 @@ xcoff_ppc_relocate_section (output_bfd, 
 	    }
 	  else if (h != NULL)
 	    {
-	      name = h->root.root.string;
+	      name = NULL;
 	    }
 	  else
 	    {
@@ -3492,8 +3492,9 @@ xcoff_ppc_relocate_section (output_bfd, 
 	  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;
 	}
 
--- binutils/bfd/coff-sh.c.overflow	2004-08-13 08:00:04.000000000 -0700
+++ binutils/bfd/coff-sh.c	2004-10-20 17:08:31.703841019 -0700
@@ -2946,7 +2946,7 @@ sh_relocate_section (output_bfd, info, i
 	    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;
@@ -2958,8 +2958,9 @@ sh_relocate_section (output_bfd, info, i
 	      }
 
 	    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;
 	  }
 	}
--- binutils/bfd/coff-tic80.c.overflow	2004-08-13 08:00:04.000000000 -0700
+++ binutils/bfd/coff-tic80.c	2004-10-20 17:08:31.705840760 -0700
@@ -695,7 +695,7 @@ coff_tic80_relocate_section (output_bfd,
 	    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);
@@ -704,8 +704,9 @@ coff_tic80_relocate_section (output_bfd,
 	      }
 
 	    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;
 	  }
 	}
--- binutils/bfd/coff-w65.c.overflow	2003-11-04 09:43:22.000000000 -0800
+++ binutils/bfd/coff-w65.c	2004-10-20 17:08:31.707840501 -0700
@@ -324,7 +324,8 @@ w65_reloc16_extra_cases (abfd, link_info
 	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 ();
@@ -348,7 +349,8 @@ w65_reloc16_extra_cases (abfd, link_info
 	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 ();
--- binutils/bfd/coff-z8k.c.overflow	2003-12-04 10:42:27.000000000 -0800
+++ binutils/bfd/coff-z8k.c	2004-10-20 17:08:31.708840372 -0700
@@ -233,7 +233,8 @@ extra_case (bfd *in_abfd,
 	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 ();
@@ -261,7 +262,8 @@ extra_case (bfd *in_abfd,
 	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 ();
@@ -288,7 +290,8 @@ extra_case (bfd *in_abfd,
 	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 ();
@@ -314,7 +317,8 @@ extra_case (bfd *in_abfd,
 	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 ();
--- binutils/bfd/coff64-rs6000.c.overflow	2004-10-11 09:35:22.000000000 -0700
+++ binutils/bfd/coff64-rs6000.c	2004-10-20 17:08:31.711839984 -0700
@@ -1335,7 +1335,7 @@ xcoff64_ppc_relocate_section (output_bfd
 	    }
 	  else if (h != NULL)
 	    {
-	      name = h->root.root.string;
+	      name = NULL;
 	    }
 	  else
 	    {
@@ -1346,8 +1346,9 @@ xcoff64_ppc_relocate_section (output_bfd
 	  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;
 	}
 
--- binutils/bfd/cofflink.c.overflow	2004-08-18 11:18:44.000000000 -0700
+++ binutils/bfd/cofflink.c	2004-10-20 17:08:31.715839467 -0700
@@ -2735,7 +2735,7 @@ _bfd_coff_reloc_link_order (bfd *output_
 	  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)
@@ -3016,7 +3016,7 @@ _bfd_coff_generic_relocate_section (bfd 
 	    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);
@@ -3025,8 +3025,9 @@ _bfd_coff_generic_relocate_section (bfd 
 	      }
 
 	    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;
 	  }
 	}
--- binutils/bfd/ecoff.c.overflow	2004-09-17 08:22:52.000000000 -0700
+++ binutils/bfd/ecoff.c	2004-10-20 17:08:31.719838950 -0700
@@ -4697,7 +4697,7 @@ ecoff_reloc_link_order (output_bfd, info
 	  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),
--- binutils/bfd/elf-hppa.h.overflow	2004-09-16 09:04:34.000000000 -0700
+++ binutils/bfd/elf-hppa.h	2004-10-20 17:08:31.723838433 -0700
@@ -1338,7 +1338,6 @@ elf_hppa_relocate_section (bfd *output_b
       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;
@@ -1463,19 +1462,6 @@ elf_hppa_relocate_section (bfd *output_b
 	    }
 	}
 
-      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,
@@ -1489,9 +1475,25 @@ elf_hppa_relocate_section (bfd *output_b
 	      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;
--- binutils/bfd/elf-m10200.c.overflow	2004-06-24 08:29:54.000000000 -0700
+++ binutils/bfd/elf-m10200.c	2004-10-20 17:08:31.725838174 -0700
@@ -410,8 +410,9 @@ mn10200_elf_relocate_section (output_bfd
 	    {
 	    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;
 
--- binutils/bfd/elf-m10300.c.overflow	2004-09-17 08:22:59.000000000 -0700
+++ binutils/bfd/elf-m10300.c	2004-10-20 17:08:31.730837528 -0700
@@ -1510,8 +1510,9 @@ mn10300_elf_relocate_section (output_bfd
 	    {
 	    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;
 
--- binutils/bfd/elf32-arm.h.overflow	2004-10-14 10:14:09.000000000 -0700
+++ binutils/bfd/elf32-arm.h	2004-10-20 17:08:31.734837011 -0700
@@ -2265,8 +2265,9 @@ elf32_arm_relocate_section (bfd *       
 	      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;
 
--- binutils/bfd/elf32-avr.c.overflow	2004-03-22 08:08:03.000000000 -0800
+++ binutils/bfd/elf32-avr.c	2004-10-20 17:08:31.736836752 -0700
@@ -736,7 +736,7 @@ elf32_avr_relocate_section (output_bfd, 
       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.  */
@@ -765,6 +765,8 @@ elf32_avr_relocate_section (output_bfd, 
 				   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,
@@ -778,7 +780,8 @@ elf32_avr_relocate_section (output_bfd, 
 	    {
 	    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;
 
--- binutils/bfd/elf32-cr16c.c.overflow	2004-04-02 07:45:51.000000000 -0800
+++ binutils/bfd/elf32-cr16c.c	2004-10-20 17:08:31.738836494 -0700
@@ -754,8 +754,9 @@ elf32_cr16c_relocate_section (bfd *outpu
 	    {
 	    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;
 
--- binutils/bfd/elf32-cris.c.overflow	2004-10-11 09:35:37.000000000 -0700
+++ binutils/bfd/elf32-cris.c	2004-10-20 17:08:31.742835977 -0700
@@ -1357,8 +1357,8 @@ cris_elf_relocate_section (output_bfd, i
 	    {
 	    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:
--- binutils/bfd/elf32-crx.c.overflow	2004-07-27 08:20:01.000000000 -0700
+++ binutils/bfd/elf32-crx.c	2004-10-20 17:08:31.744835718 -0700
@@ -868,8 +868,9 @@ elf32_crx_relocate_section (bfd *output_
 	    {
 	     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;
 
--- binutils/bfd/elf32-d10v.c.overflow	2004-03-27 17:39:08.000000000 -0800
+++ binutils/bfd/elf32-d10v.c	2004-10-20 17:08:31.746835459 -0700
@@ -547,8 +547,9 @@ elf32_d10v_relocate_section (output_bfd,
 	    {
 	    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;
 
--- binutils/bfd/elf32-fr30.c.overflow	2004-03-27 17:39:09.000000000 -0800
+++ binutils/bfd/elf32-fr30.c	2004-10-20 17:08:31.748835201 -0700
@@ -532,7 +532,7 @@ fr30_elf_relocate_section (output_bfd, i
       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);
@@ -572,6 +572,8 @@ fr30_elf_relocate_section (output_bfd, i
 				   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,
@@ -585,8 +587,8 @@ fr30_elf_relocate_section (output_bfd, i
 	    {
 	    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:
--- binutils/bfd/elf32-frv.c.overflow	2004-10-11 09:35:42.000000000 -0700
+++ binutils/bfd/elf32-frv.c	2004-10-20 17:08:31.752834684 -0700
@@ -2544,8 +2544,8 @@ elf32_frv_relocate_section (output_bfd, 
 	    {
 	    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:
--- binutils/bfd/elf32-h8300.c.overflow	2004-06-24 08:30:22.000000000 -0700
+++ binutils/bfd/elf32-h8300.c	2004-10-20 17:08:31.754834425 -0700
@@ -477,8 +477,9 @@ elf32_h8_relocate_section (bfd *output_b
 	    {
 	    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;
 
--- binutils/bfd/elf32-hppa.c.overflow	2004-09-17 08:23:24.000000000 -0700
+++ binutils/bfd/elf32-hppa.c	2004-10-20 17:08:31.758833908 -0700
@@ -3819,8 +3819,8 @@ elf32_hppa_relocate_section (bfd *output
       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;
 	}
     }
--- binutils/bfd/elf32-i370.c.overflow	2004-09-17 08:23:26.000000000 -0700
+++ binutils/bfd/elf32-i370.c	2004-10-20 17:08:31.761833520 -0700
@@ -1438,7 +1438,7 @@ i370_elf_relocate_section (output_bfd, i
 		const char *name;
 
 		if (h != NULL)
-		  name = h->root.root.string;
+		  name = NULL;
 		else
 		  {
 		    name = bfd_elf_string_from_elf_section (input_bfd,
@@ -1452,6 +1452,7 @@ i370_elf_relocate_section (output_bfd, i
 		  }
 
 		(*info->callbacks->reloc_overflow) (info,
+						    (h ? &h->root : NULL),
 						    name,
 						    howto->name,
 						    (bfd_vma) 0,
--- binutils/bfd/elf32-i386.c.overflow	2004-09-17 08:23:29.000000000 -0700
+++ binutils/bfd/elf32-i386.c	2004-10-20 17:08:31.764833132 -0700
@@ -2941,8 +2941,9 @@ elf_i386_relocate_section (bfd *output_b
 	  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
--- binutils/bfd/elf32-i860.c.overflow	2004-06-29 14:09:06.000000000 -0700
+++ binutils/bfd/elf32-i860.c	2004-10-20 17:08:31.767832744 -0700
@@ -1183,8 +1183,8 @@ elf32_i860_relocate_section (bfd *output
 	    {
 	    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:
--- binutils/bfd/elf32-ip2k.c.overflow	2004-06-24 08:30:33.000000000 -0700
+++ binutils/bfd/elf32-ip2k.c	2004-10-20 17:08:31.769832486 -0700
@@ -1545,8 +1545,8 @@ ip2k_elf_relocate_section (output_bfd, i
 	    {
 	    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:
--- binutils/bfd/elf32-iq2000.c.overflow	2004-03-27 17:39:09.000000000 -0800
+++ binutils/bfd/elf32-iq2000.c	2004-10-20 17:08:31.771832227 -0700
@@ -653,8 +653,8 @@ iq2000_elf_relocate_section (output_bfd,
 	    {
 	    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:
--- binutils/bfd/elf32-m32r.c.overflow	2004-10-11 09:35:48.000000000 -0700
+++ binutils/bfd/elf32-m32r.c	2004-10-20 17:08:31.776831581 -0700
@@ -3236,8 +3236,8 @@ m32r_elf_relocate_section (output_bfd, i
 	    {
 	    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;
 
--- binutils/bfd/elf32-m68hc1x.c.overflow	2004-08-13 08:00:07.000000000 -0700
+++ binutils/bfd/elf32-m68hc1x.c	2004-10-20 17:08:31.779831193 -0700
@@ -1173,7 +1173,7 @@ elf32_m68hc11_relocate_section (bfd *out
 	    {
 	    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;
--- binutils/bfd/elf32-m68k.c.overflow	2004-10-20 17:06:47.004378702 -0700
+++ binutils/bfd/elf32-m68k.c	2004-10-20 17:08:31.782830805 -0700
@@ -1731,8 +1731,9 @@ elf_m68k_relocate_section (output_bfd, i
 	  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
--- binutils/bfd/elf32-mcore.c.overflow	2004-08-13 08:00:08.000000000 -0700
+++ binutils/bfd/elf32-mcore.c	2004-10-20 17:08:31.784830547 -0700
@@ -520,7 +520,7 @@ mcore_elf_relocate_section (output_bfd, 
 		const char * name;
 
 		if (h != NULL)
-		  name = h->root.root.string;
+		  name = NULL;
 		else
 		  {
 		    name = bfd_elf_string_from_elf_section
@@ -534,8 +534,8 @@ mcore_elf_relocate_section (output_bfd, 
 		  }
 
 		(*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;
 	    }
--- binutils/bfd/elf32-msp430.c.overflow	2004-08-25 09:08:51.000000000 -0700
+++ binutils/bfd/elf32-msp430.c	2004-10-20 17:08:31.786830288 -0700
@@ -489,8 +489,9 @@ elf32_msp430_relocate_section (bfd * out
 	    {
 	    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:
--- binutils/bfd/elf32-openrisc.c.overflow	2004-03-27 17:39:09.000000000 -0800
+++ binutils/bfd/elf32-openrisc.c	2004-10-20 17:08:31.788830029 -0700
@@ -402,8 +402,8 @@ openrisc_elf_relocate_section (output_bf
 	    {
 	    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:
--- binutils/bfd/elf32-ppc.c.overflow	2004-10-11 09:35:55.000000000 -0700
+++ binutils/bfd/elf32-ppc.c	2004-10-20 17:08:31.793829383 -0700
@@ -5750,6 +5750,7 @@ ppc_elf_relocate_section (bfd *output_bf
 		}
 
 	      if (! (*info->callbacks->reloc_overflow) (info,
+							(h ? &h->root : NULL),
 							sym_name,
 							howto->name,
 							rel->r_addend,
--- binutils/bfd/elf32-s390.c.overflow	2004-09-17 08:23:47.000000000 -0700
+++ binutils/bfd/elf32-s390.c	2004-10-20 17:08:31.797828866 -0700
@@ -3029,8 +3029,9 @@ elf_s390_relocate_section (output_bfd, i
 	    {
 
 	      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
--- binutils/bfd/elf32-sh.c.overflow	2004-09-17 08:23:55.000000000 -0700
+++ binutils/bfd/elf32-sh.c	2004-10-20 17:08:31.803828090 -0700
@@ -5848,7 +5848,7 @@ sh_elf_relocate_section (bfd *output_bfd
 		const char *name;
 
 		if (h != NULL)
-		  name = h->root.root.string;
+		  name = NULL;
 		else
 		  {
 		    name = (bfd_elf_string_from_elf_section
@@ -5859,8 +5859,9 @@ sh_elf_relocate_section (bfd *output_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;
--- binutils/bfd/elf32-sparc.c.overflow	2004-09-27 09:11:45.000000000 -0700
+++ binutils/bfd/elf32-sparc.c	2004-10-20 17:08:31.807827573 -0700
@@ -3014,7 +3014,7 @@ elf32_sparc_relocate_section (output_bfd
 		const char *name;
 
 		if (h != NULL)
-		  name = h->root.root.string;
+		  name = NULL;
 		else
 		  {
 		    name = bfd_elf_string_from_elf_section (input_bfd,
@@ -3026,8 +3026,9 @@ elf32_sparc_relocate_section (output_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;
--- binutils/bfd/elf32-v850.c.overflow	2004-08-13 08:00:08.000000000 -0700
+++ binutils/bfd/elf32-v850.c	2004-10-20 17:08:31.811827056 -0700
@@ -1729,8 +1729,9 @@ v850_elf_relocate_section (output_bfd, i
 	    {
 	    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;
 
--- binutils/bfd/elf32-vax.c.overflow	2004-09-17 08:24:01.000000000 -0700
+++ binutils/bfd/elf32-vax.c	2004-10-20 17:08:31.814826668 -0700
@@ -1814,7 +1814,7 @@ elf_vax_relocate_section (output_bfd, in
 		const char *name;
 
 		if (h != NULL)
-		  name = h->root.root.string;
+		  name = NULL;
 		else
 		  {
 		    name = bfd_elf_string_from_elf_section (input_bfd,
@@ -1826,8 +1826,9 @@ elf_vax_relocate_section (output_bfd, in
 		      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;
--- binutils/bfd/elf32-xstormy16.c.overflow	2004-10-18 09:28:16.000000000 -0700
+++ binutils/bfd/elf32-xstormy16.c	2004-10-20 17:08:31.816826410 -0700
@@ -940,8 +940,8 @@ xstormy16_elf_relocate_section (output_b
 	    {
 	    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:
--- binutils/bfd/elf64-alpha.c.overflow	2004-09-17 08:24:12.000000000 -0700
+++ binutils/bfd/elf64-alpha.c	2004-10-20 17:08:31.822825634 -0700
@@ -4802,7 +4802,7 @@ elf64_alpha_relocate_section (output_bfd
 	      break;
 
 	    if (h != NULL)
-	      name = h->root.root.root.string;
+	      name = NULL;
 	    else
 	      {
 		name = (bfd_elf_string_from_elf_section
@@ -4813,8 +4813,9 @@ elf64_alpha_relocate_section (output_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.root : NULL), name, howto->name,
+		    (bfd_vma) 0, input_bfd, input_section,
+		    rel->r_offset)))
 	      ret_val = FALSE;
 	  }
 	  break;
--- binutils/bfd/elf64-mmix.c.overflow	2004-08-16 09:21:53.000000000 -0700
+++ binutils/bfd/elf64-mmix.c	2004-10-20 17:08:31.825825246 -0700
@@ -1500,8 +1500,8 @@ mmix_elf_relocate_section (output_bfd, i
 	    {
 	    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:
--- binutils/bfd/elf64-ppc.c.overflow	2004-10-19 09:06:56.000000000 -0700
+++ binutils/bfd/elf64-ppc.c	2004-10-20 17:08:31.833824212 -0700
@@ -9963,7 +9963,8 @@ ppc64_elf_relocate_section (bfd *output_
 		}
 
 	      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;
 	    }
--- binutils/bfd/elf64-s390.c.overflow	2004-09-17 08:24:29.000000000 -0700
+++ binutils/bfd/elf64-s390.c	2004-10-20 17:08:31.837823695 -0700
@@ -3026,8 +3026,9 @@ elf_s390_relocate_section (output_bfd, i
 	    {
 
 	      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
--- binutils/bfd/elf64-sh64.c.overflow	2004-09-17 08:24:34.000000000 -0700
+++ binutils/bfd/elf64-sh64.c	2004-10-20 17:08:31.841823177 -0700
@@ -2130,7 +2130,7 @@ sh_elf64_relocate_section (bfd *output_b
 		const char *name;
 
 		if (h != NULL)
-		  name = h->root.root.string;
+		  name = NULL;
 		else
 		  {
 		    name = (bfd_elf_string_from_elf_section
@@ -2141,8 +2141,9 @@ sh_elf64_relocate_section (bfd *output_b
 		      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;
--- binutils/bfd/elf64-sparc.c.overflow	2004-09-17 08:24:37.000000000 -0700
+++ binutils/bfd/elf64-sparc.c	2004-10-20 17:08:31.844822790 -0700
@@ -2652,7 +2652,7 @@ sparc64_elf_relocate_section (output_bfd
 		    break;
 		  }
 
-	        name = h->root.root.string;
+	        name = NULL;
 	      }
 	    else
 	      {
@@ -2666,8 +2666,9 @@ sparc64_elf_relocate_section (output_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;
--- binutils/bfd/elf64-x86-64.c.overflow	2004-10-08 09:37:21.000000000 -0700
+++ binutils/bfd/elf64-x86-64.c	2004-10-20 17:08:31.848822272 -0700
@@ -2436,8 +2436,9 @@ elf64_x86_64_relocate_section (bfd *outp
 		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
--- binutils/bfd/elflink.c.overflow	2004-10-19 09:07:07.000000000 -0700
+++ binutils/bfd/elflink.c	2004-10-20 17:08:31.855821367 -0700
@@ -7216,7 +7216,8 @@ elf_reloc_link_order (bfd *output_bfd,
 	  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;
--- binutils/bfd/elfxx-ia64.c.overflow	2004-10-20 17:08:31.236901394 -0700
+++ binutils/bfd/elfxx-ia64.c	2004-10-20 17:08:31.860820721 -0700
@@ -4535,7 +4535,7 @@ elfNN_ia64_relocate_section (output_bfd,
 	    const char *name;
 
 	    if (h)
-	      name = h->root.root.string;
+	      name = NULL;
 	    else
 	      {
 		name = bfd_elf_string_from_elf_section (input_bfd,
@@ -4544,10 +4544,10 @@ elfNN_ia64_relocate_section (output_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,
--- binutils/bfd/elfxx-mips.c.overflow	2004-09-17 08:25:05.000000000 -0700
+++ binutils/bfd/elfxx-mips.c	2004-10-20 17:08:31.868819687 -0700
@@ -6416,7 +6416,7 @@ _bfd_mips_elf_relocate_section (bfd *out
 	    {
 	      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;
 	    }
@@ -8020,7 +8020,8 @@ _bfd_elf_mips_get_relocated_section_cont
 		  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;
--- binutils/bfd/linker.c.overflow	2004-09-17 08:25:10.000000000 -0700
+++ binutils/bfd/linker.c	2004-10-20 17:08:31.872819170 -0700
@@ -2529,7 +2529,7 @@ _bfd_generic_reloc_link_order (bfd *abfd
 	  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),
--- binutils/bfd/pdp11.c.overflow	2004-08-16 09:22:07.000000000 -0700
+++ binutils/bfd/pdp11.c	2004-10-20 17:08:31.876818653 -0700
@@ -4775,7 +4775,7 @@ fprintf (stderr, "TODO: change the addre
 		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);
@@ -4787,8 +4787,9 @@ fprintf (stderr, "TODO: change the addre
 		    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;
@@ -4954,7 +4955,7 @@ aout_link_reloc_link_order (finfo, o, p)
 	  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)
--- binutils/bfd/reloc.c.overflow	2004-10-08 09:37:43.000000000 -0700
+++ binutils/bfd/reloc.c	2004-10-20 17:08:31.880818135 -0700
@@ -4499,7 +4499,8 @@ bfd_generic_get_relocated_section_conten
 		  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;
--- binutils/bfd/simple.c.overflow	2004-09-27 09:11:45.000000000 -0700
+++ binutils/bfd/simple.c	2004-10-20 17:08:31.882817877 -0700
@@ -48,6 +48,7 @@ simple_dummy_undefined_symbol (struct bf
 
 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,
--- binutils/bfd/xcofflink.c.overflow	2004-09-17 08:25:21.000000000 -0700
+++ binutils/bfd/xcofflink.c	2004-10-20 17:08:31.887817230 -0700
@@ -6043,7 +6043,7 @@ xcoff_reloc_link_order (output_bfd, finf
 	  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)))
 	    {
--- binutils/include/bfdlink.h.overflow	2004-10-07 12:10:42.000000000 -0700
+++ binutils/include/bfdlink.h	2004-10-20 17:08:31.888817101 -0700
@@ -481,16 +481,18 @@ struct bfd_link_callbacks
   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.
--- binutils/ld/ldmain.c.overflow	2004-10-07 12:10:55.000000000 -0700
+++ binutils/ld/ldmain.c	2004-10-20 22:53:48.962670598 -0700
@@ -137,8 +137,8 @@ static bfd_boolean undefined_symbol
   (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
@@ -1386,6 +1386,7 @@ int overflow_cutoff_limit = 10;
 
 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,
@@ -1408,7 +1409,32 @@ reloc_overflow (struct bfd_link_info *in
       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");


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]