This is the mail archive of the binutils-cvs@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]

[binutils-gdb] MIPS/BFD: Unify `bfd_reloc_outofrange' error reporting code


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7db9a74e9f03427ed2844a17cebecc5e793f38ef

commit 7db9a74e9f03427ed2844a17cebecc5e793f38ef
Author: Maciej W. Rozycki <macro@imgtec.com>
Date:   Tue May 24 20:45:30 2016 +0100

    MIPS/BFD: Unify `bfd_reloc_outofrange' error reporting code
    
    	bfd/
    	* elfxx-mips.c (_bfd_mips_elf_relocate_section)
    	<bfd_reloc_outofrange>: Unify error reporting code.

Diff:
---
 bfd/ChangeLog    |  5 +++++
 bfd/elfxx-mips.c | 13 +++++--------
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index 83d0bed..1be092b 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-24  Maciej W. Rozycki  <macro@imgtec.com>
+
+	* elfxx-mips.c (_bfd_mips_elf_relocate_section)
+	<bfd_reloc_outofrange>: Unify error reporting code.
+
 2016-05-23  Jim Wilson  <jim.wilson@linaro.org>
 
 	* elfnn-aarch64.c: Unconditionally enable R_AARCH64_NULL and
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c
index b561b43..d09cbf1 100644
--- a/bfd/elfxx-mips.c
+++ b/bfd/elfxx-mips.c
@@ -10259,16 +10259,13 @@ _bfd_mips_elf_relocate_section (bfd *output_bfd, struct bfd_link_info *info,
 	  break;
 
 	case bfd_reloc_outofrange:
+	  msg = NULL;
 	  if (jal_reloc_p (howto->type))
+	    msg = _("JALX to a non-word-aligned address");
+	  else if (aligned_pcrel_reloc_p (howto->type))
+	    msg = _("PC-relative load from unaligned address");
+	  if (msg)
 	    {
-	      msg = _("JALX to a non-word-aligned address");
-	      info->callbacks->warning
-		(info, msg, name, input_bfd, input_section, rel->r_offset);
-	      return FALSE;
-	    }
-	  if (aligned_pcrel_reloc_p (howto->type))
-	    {
-	      msg = _("PC-relative load from unaligned address");
 	      info->callbacks->warning
 		(info, msg, name, input_bfd, input_section, rel->r_offset);
 	      return FALSE;


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