This is the mail archive of the binutils@sourceware.org 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: ld/1208: Print out unresolvable relocation name


On Mon, Aug 22, 2005 at 02:02:40PM -0700, H. J. Lu wrote:
> In PR ld/1208, the linker is right. But the message is unclear. The
> R_386_GOTOFF relocation is only for local symbols. This patch prints
> out unresolvable relocation name.
> 
> 

This patch prints out unresolvable relocation name for other ELF
targets.


H.J.
----
2005-08-24  H.J. Lu  <hongjiu.lu@intel.com>

	PR ld/1208
	* elf-hppa.h (elf_hppa_relocate_section): Print out the name of
	unresolvable relocation.
	* elf-m10300.c (mn10300_elf_relocate_section): Likewise.
	* elf32-arm.c (elf32_arm_relocate_section): Likewise.
	* elf32-i386.c (elf_i386_relocate_section): Likewise.
	* elf32-m32r.c (m32r_elf_relocate_section): Likewise.
	* elf32-m68k.c (elf_m68k_relocate_section): Likewise.
	* elf32-s390.c (elf_s390_relocate_section): Likewise.
	* elf32-sh.c (sh_elf_relocate_section): Likewise.
	* elf32-xtensa.c (elf_xtensa_relocate_section): Likewise.
	* elf64-s390.c (elf_s390_relocate_section): Likewise.
	* elf64-sh64.c (sh_elf64_relocate_section): Likewise.
	* elf64-x86-64.c (elf64_x86_64_relocate_section): Likewise.
	* elfxx-sparc.c (_bfd_sparc_elf_relocate_section): Likewise.

--- bfd/elf-hppa.h.reloc	2005-07-29 09:02:27.000000000 -0700
+++ bfd/elf-hppa.h	2005-08-24 08:45:45.000000000 -0700
@@ -1410,8 +1410,12 @@ elf_hppa_relocate_section (bfd *output_b
 	      if (sym_sec->output_section == NULL && dyn_h == NULL)
 		{
 		  (*_bfd_error_handler)
-		    (_("%B(%A): warning: unresolvable relocation against symbol `%s'"),
-		     input_bfd, input_section, h->root.root.string);
+		    (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
+		     input_bfd,
+		     input_section,
+		     (long) rel->r_offset,
+		     howto->name,
+		     h->root.root.string);
 		  relocation = 0;
 		}
 	      else if (sym_sec->output_section)
--- bfd/elf-m10300.c.reloc	2005-08-24 08:26:57.000000000 -0700
+++ bfd/elf-m10300.c	2005-08-24 08:46:02.000000000 -0700
@@ -1457,9 +1457,12 @@ mn10300_elf_relocate_section (output_bfd
 
 	  else if (unresolved_reloc)
 	    (*_bfd_error_handler)
-	      (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
-	       bfd_get_filename (input_bfd), h->root.root.root.string,
-	       bfd_get_section_name (input_bfd, input_section));
+	      (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
+	       input_bfd,
+	       input_section,
+	       (long) rel->r_offset,
+	       howto->name,
+	       h->root.root.root.string);
 	}
 
       r = mn10300_elf_final_link_relocate (howto, input_bfd, output_bfd,
--- bfd/elf32-arm.c.reloc	2005-08-24 08:26:57.000000000 -0700
+++ bfd/elf32-arm.c	2005-08-24 08:46:18.000000000 -0700
@@ -4175,9 +4175,12 @@ elf32_arm_relocate_section (bfd *       
                && h->def_dynamic))
 	{
 	  (*_bfd_error_handler)
-	    (_("%B(%A+0x%lx): warning: unresolvable relocation %d against symbol `%s'"),
-	     input_bfd, input_section, (long) rel->r_offset,
-	     r_type, h->root.root.string);
+	    (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
+	     input_bfd,
+	     input_section,
+	     (long) rel->r_offset,
+	     howto->name,
+	     h->root.root.string);
 	  return FALSE;
 	}
 
--- bfd/elf32-i386.c.reloc	2005-08-24 08:26:58.000000000 -0700
+++ bfd/elf32-i386.c	2005-08-24 08:30:46.000000000 -0700
@@ -3037,10 +3037,11 @@ elf_i386_relocate_section (bfd *output_b
 	       && h->def_dynamic))
 	{
 	  (*_bfd_error_handler)
-	    (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+	    (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
 	     input_bfd,
 	     input_section,
 	     (long) rel->r_offset,
+	     howto->name,
 	     h->root.root.string);
 	  return FALSE;
 	}
--- bfd/elf32-m32r.c.reloc	2005-08-24 08:26:58.000000000 -0700
+++ bfd/elf32-m32r.c	2005-08-24 08:44:37.000000000 -0700
@@ -2653,9 +2653,12 @@ m32r_elf_relocate_section (bfd *output_b
 		  else if (sec->output_section == NULL)
                     {
                       (*_bfd_error_handler)
-                        (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
-                         bfd_get_filename (input_bfd), h->root.root.string,
-                         bfd_get_section_name (input_bfd, input_section));
+                        (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
+			 input_bfd,
+			 input_section,
+			 (long) rel->r_offset,
+			 howto->name,
+			 h->root.root.string);
 
 		       relocation = 0;
                     }
--- bfd/elf32-m68k.c.reloc	2005-08-24 08:26:59.000000000 -0700
+++ bfd/elf32-m68k.c	2005-08-24 08:38:19.000000000 -0700
@@ -1732,10 +1732,11 @@ elf_m68k_relocate_section (output_bfd, i
 	       && h->def_dynamic))
 	{
 	  (*_bfd_error_handler)
-	    (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+	    (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
 	     input_bfd,
 	     input_section,
 	     (long) rel->r_offset,
+	     howto->name,
 	     h->root.root.string);
 	  return FALSE;
 	}
--- bfd/elf32-s390.c.reloc	2005-08-24 08:27:00.000000000 -0700
+++ bfd/elf32-s390.c	2005-08-24 08:38:30.000000000 -0700
@@ -3014,10 +3014,11 @@ elf_s390_relocate_section (output_bfd, i
 	  && !((input_section->flags & SEC_DEBUGGING) != 0
 	       && h->def_dynamic))
 	(*_bfd_error_handler)
-	  (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+	  (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
 	   input_bfd,
 	   input_section,
 	   (long) rel->r_offset,
+	   howto->name,
 	   h->root.root.string);
 
       if (r_type == R_390_20
--- bfd/elf32-sh.c.reloc	2005-08-24 08:27:01.000000000 -0700
+++ bfd/elf32-sh.c	2005-08-24 08:46:50.000000000 -0700
@@ -4714,8 +4714,12 @@ sh_elf_relocate_section (bfd *output_bfd
 	      else if (sec->output_section == NULL)
 		{
 		  (*_bfd_error_handler)
-		    (_("%B(%A): unresolvable relocation against symbol `%s'"),
-		     input_bfd, input_section, h->root.root.string);
+		    (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
+		     input_bfd,
+		     input_section,
+		     (long) rel->r_offset,
+		     howto->name,
+		     h->root.root.string);
 		  return FALSE;
 		}
 	      else
--- bfd/elf32-xtensa.c.reloc	2005-08-24 08:27:01.000000000 -0700
+++ bfd/elf32-xtensa.c	2005-08-24 08:38:56.000000000 -0700
@@ -2308,10 +2308,11 @@ elf_xtensa_relocate_section (bfd *output
 	  && !((input_section->flags & SEC_DEBUGGING) != 0
 	       && h->def_dynamic))
 	(*_bfd_error_handler)
-	  (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+	  (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
 	   input_bfd,
 	   input_section,
 	   (long) rel->r_offset,
+	   howto->name,
 	   h->root.root.string);
 
       /* There's no point in calling bfd_perform_relocation here.
--- bfd/elf64-s390.c.reloc	2005-08-24 08:27:02.000000000 -0700
+++ bfd/elf64-s390.c	2005-08-24 08:39:09.000000000 -0700
@@ -3011,10 +3011,11 @@ elf_s390_relocate_section (output_bfd, i
 	  && !((input_section->flags & SEC_DEBUGGING) != 0
 	       && h->def_dynamic))
 	(*_bfd_error_handler)
-	  (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+	  (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
 	   input_bfd,
 	   input_section,
 	   (long) rel->r_offset,
+	   howto->name,
 	   h->root.root.string);
 
       if (r_type == R_390_20
--- bfd/elf64-sh64.c.reloc	2005-08-24 08:27:02.000000000 -0700
+++ bfd/elf64-sh64.c	2005-08-24 08:47:06.000000000 -0700
@@ -1623,9 +1623,12 @@ sh_elf64_relocate_section (bfd *output_b
 	      else if (sec->output_section == NULL)
 		{
 		  (*_bfd_error_handler)
-		    (_("%s: warning: unresolvable relocation against symbol `%s' from %s section"),
-		     bfd_get_filename (input_bfd), h->root.root.string,
-		     bfd_get_section_name (input_bfd, input_section));
+		    (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
+		     input_bfd,
+		     input_section,
+		     (long) rel->r_offset,
+		     howto->name,
+		     h->root.root.string);
 		  relocation = 0;
 		}
 	      else
--- bfd/elf64-x86-64.c.reloc	2005-08-24 08:27:03.000000000 -0700
+++ bfd/elf64-x86-64.c	2005-08-24 08:40:23.000000000 -0700
@@ -2519,10 +2519,11 @@ elf64_x86_64_relocate_section (bfd *outp
 	  && !((input_section->flags & SEC_DEBUGGING) != 0
 	       && h->def_dynamic))
 	(*_bfd_error_handler)
-	  (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+	  (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
 	   input_bfd,
 	   input_section,
 	   (long) rel->r_offset,
+	   howto->name,
 	   h->root.root.string);
 
       r = _bfd_final_link_relocate (howto, input_bfd, input_section,
--- bfd/elfxx-sparc.c.reloc	2005-08-24 08:27:03.000000000 -0700
+++ bfd/elfxx-sparc.c	2005-08-24 08:43:15.000000000 -0700
@@ -3138,10 +3138,11 @@ _bfd_sparc_elf_relocate_section (bfd *ou
 	  && !((input_section->flags & SEC_DEBUGGING) != 0
 	       && h->def_dynamic))
 	(*_bfd_error_handler)
-	  (_("%B(%A+0x%lx): unresolvable relocation against symbol `%s'"),
+	  (_("%B(%A+0x%lx): unresolvable %s relocation against symbol `%s'"),
 	   input_bfd,
 	   input_section,
 	   (long) rel->r_offset,
+	   howto->name,
 	   h->root.root.string);
 
       r = bfd_reloc_continue;


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