From: Yufeng Zhang Date: Tue, 12 Feb 2013 14:27:39 +0000 (+0000) Subject: Add missing alignment check to load/store uimm12 immediate offset. X-Git-Tag: binutils-2_23_2~57 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=49dd82e6eab3c2bbfa3003003a1f976ed62d8fed;p=thirdparty%2Fbinutils-gdb.git Add missing alignment check to load/store uimm12 immediate offset. opcodes/ * aarch64-opc.c (operand_general_constraint_met_p): Change to check the alignment of addr.offset.imm instead of that of shifter.amount for operand type AARCH64_OPND_ADDR_UIMM12. gas/testsuite/ * gas/aarch64/illegal-2.s: Add test case. * gas/aarch64/illegal-2.l: Likewise. --- diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 929a20829b7..d98df81e55a 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-02-12 Yufeng Zhang + + * gas/aarch64/illegal-2.s: Add test case. + * gas/aarch64/illegal-2.l: Likewise. + 2013-01-22 Alan Modra Apply mainline patches diff --git a/gas/testsuite/gas/aarch64/illegal-2.l b/gas/testsuite/gas/aarch64/illegal-2.l index 2ba68948382..372596b0f3b 100644 --- a/gas/testsuite/gas/aarch64/illegal-2.l +++ b/gas/testsuite/gas/aarch64/illegal-2.l @@ -6,3 +6,4 @@ [^:]*:16: Error: .*$ [^:]*:19: Error: .*$ [^:]*:20: Error: .*$ +[^:]*:24: Error: .*$ diff --git a/gas/testsuite/gas/aarch64/illegal-2.s b/gas/testsuite/gas/aarch64/illegal-2.s index 3aa7283ba71..7711e14d55b 100644 --- a/gas/testsuite/gas/aarch64/illegal-2.s +++ b/gas/testsuite/gas/aarch64/illegal-2.s @@ -20,3 +20,5 @@ mov wsp, #0x33030000 .set u16, 0xfff0 + + ldr x0, [x0, #257] diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 1c2a10f3e97..03c1fabb878 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,9 @@ +2013-02-12 Yufeng Zhang + + * aarch64-opc.c (operand_general_constraint_met_p): Change to + check the alignment of addr.offset.imm instead of that of + shifter.amount for operand type AARCH64_OPND_ADDR_UIMM12. + 2013-01-22 Alan Modra Apply mainline patches diff --git a/opcodes/aarch64-opc.c b/opcodes/aarch64-opc.c index 68572f82430..338729eac32 100644 --- a/opcodes/aarch64-opc.c +++ b/opcodes/aarch64-opc.c @@ -1426,7 +1426,7 @@ operand_general_constraint_met_p (const aarch64_opnd_info *opnds, int idx, 0, 4095 * size); return 0; } - if (!value_aligned_p (opnd->shifter.amount, size)) + if (!value_aligned_p (opnd->addr.offset.imm, size)) { set_unaligned_error (mismatch_detail, idx, size); return 0;