This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [Patch, AArch64, 1/5] backport recent fixes to 2.23 - add missing alignment check
- From: Yufeng Zhang <Yufeng dot Zhang at arm dot com>
- To: binutils at sourceware dot org
- Cc: gingold at adacore dot com, Marcus Shawcroft <Marcus dot Shawcroft at arm dot com>
- Date: Mon, 11 Feb 2013 22:54:25 +0000
- Subject: Re: [Patch, AArch64, 1/5] backport recent fixes to 2.23 - add missing alignment check
- References: <51197585.2040508@arm.com>
This patch adds missing alignment check to load/store uimm12 immediate
offset. It was committed to the trunk at:
http://sourceware.org/ml/binutils-cvs/2012-10/msg00058.html
OK for 2_23-branch?
Thanks,
Yufeng
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/gas/aarch64/illegal-2.l b/gas/testsuite/gas/aarch64/illegal-2.l
index 2ba6894..372596b 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 3aa7283..7711e14 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 68572f8..338729e 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;