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]

frv error message tidy


I took a dislike to seeing "warning:" on an error message, hence the
following patch.  I won't commit this one until the 2.21 release
branch is cut, to save translation project churn.

	* elf32-frv.c (elf32_frv_relocate_section): Use callbacks->einfo
	in place of callbacks->warning and bfd_error_handler.
	(elf32_frvfdpic_finish_dynamic_sections): Likewise.
	(elf32_frv_check_relocs): Likewise.

Index: bfd/elf32-frv.c
===================================================================
RCS file: /cvs/src/src/bfd/elf32-frv.c,v
retrieving revision 1.70
diff -u -p -r1.70 elf32-frv.c
--- bfd/elf32-frv.c	11 Oct 2010 09:11:34 -0000	1.70
+++ bfd/elf32-frv.c	11 Oct 2010 09:15:09 -0000
@@ -2891,8 +2891,9 @@ elf32_frv_relocate_section (output_bfd, 
 						      osec, sym,
 						      rel->r_addend))
 	    {
-	      (*_bfd_error_handler)
-		(_("%B(%A+0x%x): relocation to `%s+%x' may have caused the error above"),
+	      info->callbacks->einfo
+		(_("%C: relocation to `%s+%x'"
+		   " may have caused the error above\n"),
 		 input_bfd, input_section, rel->r_offset, name, rel->r_addend);
 	      return FALSE;
 	    }
@@ -2904,9 +2905,10 @@ elf32_frv_relocate_section (output_bfd, 
 	  picrel = NULL;
 	  if (h && ! FRVFDPIC_SYM_LOCAL (info, h))
 	    {
-	      info->callbacks->warning
-		(info, _("relocation references symbol not defined in the module"),
-		 name, input_bfd, input_section, rel->r_offset);
+	      info->callbacks->einfo
+		(_("%C: relocation references symbol"
+		   " not defined in the module\n"),
+		 input_bfd, input_section, rel->r_offset);
 	      return FALSE;
 	    }
 	  break;
@@ -2979,10 +2981,9 @@ elf32_frv_relocate_section (output_bfd, 
 	    /* Is this a call instruction?  */
 	    if ((insn & (unsigned long)0x01fc0000) != 0x003c0000)
 	      {
-		r = info->callbacks->warning
-		  (info,
-		   _("R_FRV_GETTLSOFF not applied to a call instruction"),
-		   name, input_bfd, input_section, rel->r_offset);
+		info->callbacks->einfo
+		  (_("%C: R_FRV_GETTLSOFF not applied to a call instruction\n"),
+		   input_bfd, input_section, rel->r_offset);
 		return FALSE;
 	      }
 
@@ -3021,10 +3022,10 @@ elf32_frv_relocate_section (output_bfd, 
 	    /* Is this an lddi instruction?  */
 	    if ((insn & (unsigned long)0x01fc0000) != 0x00cc0000)
 	      {
-		r = info->callbacks->warning
-		  (info,
-		   _("R_FRV_GOTTLSDESC12 not applied to an lddi instruction"),
-		   name, input_bfd, input_section, rel->r_offset);
+		info->callbacks->einfo
+		  (_("%C: R_FRV_GOTTLSDESC12"
+		     " not applied to an lddi instruction\n"),
+		   input_bfd, input_section, rel->r_offset);
 		return FALSE;
 	      }
 
@@ -3092,10 +3093,10 @@ elf32_frv_relocate_section (output_bfd, 
 	    /* Is this a sethi instruction?  */
 	    if ((insn & (unsigned long)0x01ff0000) != 0x00f80000)
 	      {
-		r = info->callbacks->warning
-		  (info,
-		   _("R_FRV_GOTTLSDESCHI not applied to a sethi instruction"),
-		   name, input_bfd, input_section, rel->r_offset);
+		info->callbacks->einfo
+		  (_("%C: R_FRV_GOTTLSDESCHI"
+		     " not applied to a sethi instruction\n"),
+		   input_bfd, input_section, rel->r_offset);
 		return FALSE;
 	      }
 
@@ -3129,11 +3130,10 @@ elf32_frv_relocate_section (output_bfd, 
 	    /* Is this a setlo or setlos instruction?  */
 	    if ((insn & (unsigned long)0x01f70000) != 0x00f40000)
 	      {
-		r = info->callbacks->warning
-		  (info,
-		   _("R_FRV_GOTTLSDESCLO"
-		     " not applied to a setlo or setlos instruction"),
-		   name, input_bfd, input_section, rel->r_offset);
+		info->callbacks->einfo
+		  (_("%C: R_FRV_GOTTLSDESCLO"
+		     " not applied to a setlo or setlos instruction\n"),
+		   input_bfd, input_section, rel->r_offset);
 		return FALSE;
 	      }
 
@@ -3177,10 +3177,10 @@ elf32_frv_relocate_section (output_bfd, 
 	    /* Is this an ldd instruction?  */
 	    if ((insn & (unsigned long)0x01fc0fc0) != 0x00080140)
 	      {
-		r = info->callbacks->warning
-		  (info,
-		   _("R_FRV_TLSDESC_RELAX not applied to an ldd instruction"),
-		   name, input_bfd, input_section, rel->r_offset);
+		info->callbacks->einfo
+		  (_("%C: R_FRV_TLSDESC_RELAX"
+		     " not applied to an ldd instruction\n"),
+		   input_bfd, input_section, rel->r_offset);
 		return FALSE;
 	      }
 
@@ -3261,11 +3261,10 @@ elf32_frv_relocate_section (output_bfd, 
 	    /* Is this a calll or callil instruction?  */
 	    if ((insn & (unsigned long)0x7ff80fc0) != 0x02300000)
 	      {
-		r = info->callbacks->warning
-		  (info,
-		   _("R_FRV_GETTLSOFF_RELAX"
-		     " not applied to a calll instruction"),
-		   name, input_bfd, input_section, rel->r_offset);
+		info->callbacks->einfo
+		  (_("%C: R_FRV_GETTLSOFF_RELAX"
+		     " not applied to a calll instruction\n"),
+		   input_bfd, input_section, rel->r_offset);
 		return FALSE;
 	      }
 
@@ -3316,10 +3315,10 @@ elf32_frv_relocate_section (output_bfd, 
 	    /* Is this an ldi instruction?  */
 	    if ((insn & (unsigned long)0x01fc0000) != 0x00c80000)
 	      {
-		r = info->callbacks->warning
-		  (info,
-		   _("R_FRV_GOTTLSOFF12 not applied to an ldi instruction"),
-		   name, input_bfd, input_section, rel->r_offset);
+		info->callbacks->einfo
+		  (_("%C: R_FRV_GOTTLSOFF12"
+		     " not applied to an ldi instruction\n"),
+		   input_bfd, input_section, rel->r_offset);
 		return FALSE;
 	      }
 
@@ -3346,10 +3345,10 @@ elf32_frv_relocate_section (output_bfd, 
 	    /* Is this a sethi instruction?  */
 	    if ((insn & (unsigned long)0x01ff0000) != 0x00f80000)
 	      {
-		r = info->callbacks->warning
-		  (info,
-		   _("R_FRV_GOTTLSOFFHI not applied to a sethi instruction"),
-		   name, input_bfd, input_section, rel->r_offset);
+		info->callbacks->einfo
+		  (_("%C: R_FRV_GOTTLSOFFHI"
+		     " not applied to a sethi instruction\n"),
+		   input_bfd, input_section, rel->r_offset);
 		return FALSE;
 	      }
 
@@ -3375,11 +3374,10 @@ elf32_frv_relocate_section (output_bfd, 
 	    /* Is this a setlo or setlos instruction?  */
 	    if ((insn & (unsigned long)0x01f70000) != 0x00f40000)
 	      {
-		r = info->callbacks->warning
-		  (info,
-		   _("R_FRV_GOTTLSOFFLO"
-		     " not applied to a setlo or setlos instruction"),
-		   name, input_bfd, input_section, rel->r_offset);
+		info->callbacks->einfo
+		  (_("%C: R_FRV_GOTTLSOFFLO"
+		     " not applied to a setlo or setlos instruction\n"),
+		   input_bfd, input_section, rel->r_offset);
 		return FALSE;
 	      }
 
@@ -3406,10 +3404,10 @@ elf32_frv_relocate_section (output_bfd, 
 	    /* Is this an ld instruction?  */
 	    if ((insn & (unsigned long)0x01fc0fc0) != 0x00080100)
 	      {
-		r = info->callbacks->warning
-		  (info,
-		   _("R_FRV_TLSOFF_RELAX not applied to an ld instruction"),
-		   name, input_bfd, input_section, rel->r_offset);
+		info->callbacks->einfo
+		  (_("%C: R_FRV_TLSOFF_RELAX"
+		     " not applied to an ld instruction\n"),
+		   input_bfd, input_section, rel->r_offset);
 		return FALSE;
 	      }
 
@@ -3451,10 +3449,10 @@ elf32_frv_relocate_section (output_bfd, 
 	    /* Is this a sethi instruction?  */
 	    if ((insn & (unsigned long)0x01ff0000) != 0x00f80000)
 	      {
-		r = info->callbacks->warning
-		  (info,
-		   _("R_FRV_TLSMOFFHI not applied to a sethi instruction"),
-		   name, input_bfd, input_section, rel->r_offset);
+		info->callbacks->einfo
+		  (_("%C: R_FRV_TLSMOFFHI"
+		     " not applied to a sethi instruction\n"),
+		   input_bfd, input_section, rel->r_offset);
 		return FALSE;
 	      }
 
@@ -3478,11 +3476,10 @@ elf32_frv_relocate_section (output_bfd, 
 	    /* Is this a setlo or setlos instruction?  */
 	    if ((insn & (unsigned long)0x01f70000) != 0x00f40000)
 	      {
-		r = info->callbacks->warning
-		  (info,
-		   _("R_FRV_TLSMOFFLO"
-		     " not applied to a setlo or setlos instruction"),
-		   name, input_bfd, input_section, rel->r_offset);
+		info->callbacks->einfo
+		  (_("R_FRV_TLSMOFFLO"
+		     " not applied to a setlo or setlos instruction\n"),
+		   input_bfd, input_section, rel->r_offset);
 		return FALSE;
 	      }
 
@@ -3600,9 +3597,10 @@ elf32_frv_relocate_section (output_bfd, 
 		  {
 		    if (addend)
 		      {
-			info->callbacks->warning
-			  (info, _("R_FRV_FUNCDESC references dynamic symbol with nonzero addend"),
-			   name, input_bfd, input_section, rel->r_offset);
+			info->callbacks->einfo
+			  (_("%C: R_FRV_FUNCDESC references dynamic symbol"
+			     " with nonzero addend\n"),
+			   input_bfd, input_section, rel->r_offset);
 			return FALSE;
 		      }
 		    dynindx = h->dynindx;
@@ -3640,10 +3638,10 @@ elf32_frv_relocate_section (output_bfd, 
 						       input_section
 						       ->output_section))
 			  {
-			    info->callbacks->warning
-			      (info,
-			       _("cannot emit fixups in read-only section"),
-			       name, input_bfd, input_section, rel->r_offset);
+			    info->callbacks->einfo
+			      (_("%C: cannot emit fixups"
+				 " in read-only section\n"),
+			       input_bfd, input_section, rel->r_offset);
 			    return FALSE;
 			  }
 
@@ -3671,10 +3669,10 @@ elf32_frv_relocate_section (output_bfd, 
 						   input_section
 						   ->output_section))
 		      {
-			info->callbacks->warning
-			  (info,
-			   _("cannot emit dynamic relocations in read-only section"),
-			   name, input_bfd, input_section, rel->r_offset);
+			info->callbacks->einfo
+			  (_("%C: cannot emit dynamic relocations"
+			     " in read-only section\n"),
+			   input_bfd, input_section, rel->r_offset);
 			return FALSE;
 		      }
 
@@ -3720,9 +3718,10 @@ elf32_frv_relocate_section (output_bfd, 
 	      {
 		if (addend && r_type == R_FRV_FUNCDESC_VALUE)
 		  {
-		    info->callbacks->warning
-		      (info, _("R_FRV_FUNCDESC_VALUE references dynamic symbol with nonzero addend"),
-		       name, input_bfd, input_section, rel->r_offset);
+		    info->callbacks->einfo
+		      (_("%C: R_FRV_FUNCDESC_VALUE"
+			 " references dynamic symbol with nonzero addend\n"),
+		       input_bfd, input_section, rel->r_offset);
 		    return FALSE;
 		  }
 		dynindx = h->dynindx;
@@ -3761,10 +3760,9 @@ elf32_frv_relocate_section (output_bfd, 
 						   input_section
 						   ->output_section))
 		      {
-			info->callbacks->warning
-			  (info,
-			   _("cannot emit fixups in read-only section"),
-			   name, input_bfd, input_section, rel->r_offset);
+			info->callbacks->einfo
+			  (_("%C: cannot emit fixups in read-only section\n"),
+			   input_bfd, input_section, rel->r_offset);
 			return FALSE;
 		      }
 		    if (!h || h->root.type != bfd_link_hash_undefweak)
@@ -3805,10 +3803,10 @@ elf32_frv_relocate_section (output_bfd, 
 						   input_section
 						   ->output_section))
 		      {
-			info->callbacks->warning
-			  (info,
-			   _("cannot emit dynamic relocations in read-only section"),
-			   name, input_bfd, input_section, rel->r_offset);
+			info->callbacks->einfo
+			  (_("%C: cannot emit dynamic relocations"
+			     " in read-only section\n"),
+			   input_bfd, input_section, rel->r_offset);
 			return FALSE;
 		      }
 
@@ -3976,16 +3974,9 @@ elf32_frv_relocate_section (output_bfd, 
 	      && !(picrel && picrel->symndx == -1
 		   && picrel->d.h->root.type == bfd_link_hash_undefined))
 	    {
-	      if (info->shared || info->pie)
-		(*_bfd_error_handler)
-		  (_("%B(%A+0x%lx): reloc against `%s': %s"),
-		   input_bfd, input_section, (long)rel->r_offset, name,
-		   _("relocation references a different segment"));
-	      else
-		info->callbacks->warning
-		  (info,
-		   _("relocation references a different segment"),
-		   name, input_bfd, input_section, rel->r_offset);
+	      info->callbacks->einfo
+		(_("%C: reloc against `%s' references a different segment\n"),
+		 input_bfd, input_section, rel->r_offset, name);
 	    }
 	  if (!silence_segment_error && (info->shared || info->pie))
 	    return FALSE;
@@ -4133,9 +4124,9 @@ elf32_frv_relocate_section (output_bfd, 
 
 	  if (msg)
 	    {
-	      (*_bfd_error_handler)
-		(_("%B(%A+0x%lx): reloc against `%s': %s"),
-		 input_bfd, input_section, (long)rel->r_offset, name, msg);
+	      info->callbacks->einfo
+		(_("%C: reloc against `%s': %s\n"),
+		 input_bfd, input_section, rel->r_offset, name, msg);
 	      return FALSE;
 	    }
 
@@ -5889,8 +5880,8 @@ elf32_frvfdpic_finish_dynamic_sections (
 	      != (frvfdpic_gotfixup_section (info)->reloc_count * 4))
 	    {
 	    error:
-	      (*_bfd_error_handler)
-		("LINKER BUG: .rofixup section size mismatch");
+	      info->callbacks->einfo
+		("LINKER BUG: .rofixup section size mismatch\n");
 	      return FALSE;
 	    }
 
@@ -6409,8 +6400,8 @@ elf32_frv_check_relocs (abfd, info, sec,
 
 	default:
 	bad_reloc:
-	  (*_bfd_error_handler)
-	    (_("%B: unsupported relocation type %i"),
+	  info->callbacks->einfo
+	    (_("%B: unsupported relocation type %i\n"),
 	     abfd, ELF32_R_TYPE (rel->r_info));
 	  return FALSE;
         }

-- 
Alan Modra
Australia Development Lab, IBM


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