aboutsummaryrefslogtreecommitdiff
path: root/gas/config
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2009-07-14 12:54:47 +0000
committerNick Clifton <nickc@redhat.com>2009-07-14 12:54:47 +0000
commit752d5da4523a0bbef4e8aad05b9a2cfbd5ecd573 (patch)
treee2532b1cc115f7d1faf18e658df3f8a5389ef60f /gas/config
parent1aa604e1750feb1f2dfec8a3418875f3a7bba68d (diff)
downloadgdb-752d5da4523a0bbef4e8aad05b9a2cfbd5ecd573.zip
gdb-752d5da4523a0bbef4e8aad05b9a2cfbd5ecd573.tar.gz
gdb-752d5da4523a0bbef4e8aad05b9a2cfbd5ecd573.tar.bz2
gas/
* config/tc-arm.c (md_assemble): Added validation. gas/testsuite * gas/arm/thumb-w-bad.d: New test case. * gas/arm/thumb-w-bad.l: New file. * gas/arm/thumb-w-bad.s: New file. * gas/arm/thumb-w-good.d: New test case. * gas/arm/thumb-w-good.s: New file.
Diffstat (limited to 'gas/config')
-rw-r--r--gas/config/tc-arm.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index b4b83d0..95d6a8d 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -15372,14 +15372,25 @@ md_assemble (char *str)
return;
}
- if (!ARM_CPU_HAS_FEATURE (variant, arm_ext_v6t2) && !inst.size_req)
+ if (!ARM_CPU_HAS_FEATURE (variant, arm_ext_v6t2))
{
- /* Implicit require narrow instructions on Thumb-1. This avoids
- relaxation accidentally introducing Thumb-2 instructions. */
if (opcode->tencode != do_t_blx && opcode->tencode != do_t_branch23
- && !(ARM_CPU_HAS_FEATURE (*opcode->tvariant, arm_ext_msr)
- || ARM_CPU_HAS_FEATURE (*opcode->tvariant, arm_ext_barrier)))
- inst.size_req = 2;
+ && !(ARM_CPU_HAS_FEATURE(*opcode->tvariant, arm_ext_msr)
+ || ARM_CPU_HAS_FEATURE(*opcode->tvariant, arm_ext_barrier)))
+ {
+ /* Two things are addressed here.
+ 1) Implicit require narrow instructions on Thumb-1.
+ This avoids relaxation accidentally introducing Thumb-2
+ instructions.
+ 2) Reject wide instructions in non Thumb-2 cores. */
+ if (inst.size_req == 0)
+ inst.size_req = 2;
+ else if (inst.size_req == 4)
+ {
+ as_bad (_("selected processor does not support `%s'"), str);
+ return;
+ }
+ }
}
mapping_state (MAP_THUMB);