aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryufeng <yufeng>2012-10-15 14:52:05 +0000
committeryufeng <yufeng>2012-10-15 14:52:05 +0000
commit0cf58d0ed8d221ee0971470f45e5343f2de1336a (patch)
tree4bb8d12aac2f8058689d4f12deeb5520dbd9c5c2
parent04b5409b647d4950c153308009d9d7689187d880 (diff)
downloadbinutils-0cf58d0ed8d221ee0971470f45e5343f2de1336a.tar.gz
Added 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.
-rw-r--r--gas/testsuite/gas/aarch64/illegal-2.l1
-rw-r--r--gas/testsuite/gas/aarch64/illegal-2.s2
-rw-r--r--opcodes/aarch64-opc.c2
3 files changed, 4 insertions, 1 deletions
diff --git a/gas/testsuite/gas/aarch64/illegal-2.l b/gas/testsuite/gas/aarch64/illegal-2.l
index 2ba689483..372596b0f 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 3aa7283ba..7711e14d5 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/aarch64-opc.c b/opcodes/aarch64-opc.c
index 2d66a255e..8c7093830 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;