MIPS/BFD: Unify `bfd_reloc_outofrange' error reporting code
authorMaciej W. Rozycki <macro@imgtec.com>
Tue, 24 May 2016 19:45:30 +0000 (20:45 +0100)
committerMaciej W. Rozycki <macro@imgtec.com>
Tue, 24 May 2016 19:48:14 +0000 (20:48 +0100)
bfd/
* elfxx-mips.c (_bfd_mips_elf_relocate_section)
<bfd_reloc_outofrange>: Unify error reporting code.

bfd/ChangeLog
bfd/elfxx-mips.c

index 83d0bed5e4179fef17711e4fff852253c7c601cc..1be092bc52f93928b8e1f743f3887ef3973248f0 100644 (file)
@@ -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
index b561b430611472b82321969383e678b7584cb452..d09cbf12221933b78612cbe256ec765d85a220e9 100644 (file)
@@ -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;