* config/tc-mips.c (append_insn): Give an error for jumps to a
authorIan Lance Taylor <ian@airs.com>
Tue, 28 Jan 1997 21:14:37 +0000 (21:14 +0000)
committerIan Lance Taylor <ian@airs.com>
Tue, 28 Jan 1997 21:14:37 +0000 (21:14 +0000)
misaligned address.

gas/ChangeLog
gas/config/tc-mips.c

index cf6c8e7a19a704f0f1b04c21d5c900c0b409bf5f..f9bf733b1b0783dd31138477bd93c478b01ff22c 100644 (file)
@@ -1,7 +1,9 @@
 Tue Jan 28 15:27:28 1997  Ian Lance Taylor  <ian@cygnus.com>
 
-       * config/tc-mips.c (md_apply_fix): Make a branch to an odd address
-       an error rather than a warning.
+       * config/tc-mips.c (append_insn): Give an error for jumps to a
+       misaligned address.
+       (md_apply_fix): Make a branch to an odd address an error rather
+       than a warning.
 
        * config/tc-mips.c (md_convert_frag): If the user explicitly
        requested an extended opcode, pass warn as true to mips16_immed.
index 828ebc0b87ebde9ef26fa52f471185766af62386..3378aeb48c679a09169681feed3ffd6f15ae6ff5 100644 (file)
@@ -1461,10 +1461,16 @@ append_insn (place, ip, address_expr, reloc_type, unmatched_hi)
              break;
 
            case BFD_RELOC_MIPS_JMP:
+             if ((address_expr->X_add_number & 3) != 0)
+               as_bad ("jump to misaligned address (0x%lx)",
+                       (unsigned long) address_expr->X_add_number);
              ip->insn_opcode |= (address_expr->X_add_number >> 2) & 0x3ffffff;
              break;
 
            case BFD_RELOC_MIPS16_JMP:
+             if ((address_expr->X_add_number & 3) != 0)
+               as_bad ("jump to misaligned address (0x%lx)",
+                       (unsigned long) address_expr->X_add_number);
              ip->insn_opcode |=
                (((address_expr->X_add_number & 0x7c0000) << 3)
                 | ((address_expr->X_add_number & 0xf800000) >> 7)