From: Ian Lance Taylor Date: Tue, 28 Jan 1997 21:14:37 +0000 (+0000) Subject: * config/tc-mips.c (append_insn): Give an error for jumps to a X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=39bb58e0adc7a5caccdd284d3ead53728214f5dd;p=binutils-gdb.git * config/tc-mips.c (append_insn): Give an error for jumps to a misaligned address. --- diff --git a/gas/ChangeLog b/gas/ChangeLog index cf6c8e7a19a..f9bf733b1b0 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,7 +1,9 @@ Tue Jan 28 15:27:28 1997 Ian Lance Taylor - * 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. diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c index 828ebc0b87e..3378aeb48c6 100644 --- a/gas/config/tc-mips.c +++ b/gas/config/tc-mips.c @@ -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)