diff options
author | Nick Clifton <nickc@redhat.com> | 2012-06-28 15:38:15 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2012-06-28 15:38:15 +0000 |
commit | 2b2f5df9024a4e17e7b63887c6610b36bfec4542 (patch) | |
tree | 9772c7f7e1a1a862c3846fd628a4792b00f32ecb /gas/config | |
parent | 4c6a93d362bc65b75e1f07d547b3e40be2f4e904 (diff) | |
download | gdb-2b2f5df9024a4e17e7b63887c6610b36bfec4542.zip gdb-2b2f5df9024a4e17e7b63887c6610b36bfec4542.tar.gz gdb-2b2f5df9024a4e17e7b63887c6610b36bfec4542.tar.bz2 |
PR gas/14260
* config/tc-arm.c (encode_arm_addr_mode_common): Generate an error
message if literal pool addressing is used.
* gas/arm/ldr-t-bad.s: Add test of bogus use of literal pool
addressing.
* gas/arm/ldr-t-bad.l: Update expected assembler error message
output.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-arm.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 2257d4e..43e20d1 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -7042,7 +7042,11 @@ encode_arm_shifter_operand (int i) static void encode_arm_addr_mode_common (int i, bfd_boolean is_t) { - gas_assert (inst.operands[i].isreg); + /* PR 14260: + Generate an error if the operand is not a register. */ + constraint (!inst.operands[i].isreg, + _("Instruction does not support =N addresses")); + inst.instruction |= inst.operands[i].reg << 16; if (inst.operands[i].preind) @@ -21269,8 +21273,8 @@ md_apply_fix (fixS * fixP, thumb_bl_common: #ifdef OBJ_ELF - if (EF_ARM_EABI_VERSION (meabi_flags) >= EF_ARM_EABI_VER4 && - fixP->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX) + if (EF_ARM_EABI_VERSION (meabi_flags) >= EF_ARM_EABI_VER4 + && fixP->fx_r_type == BFD_RELOC_THUMB_PCREL_BLX) fixP->fx_r_type = BFD_RELOC_THUMB_PCREL_BRANCH23; #endif @@ -21281,15 +21285,15 @@ md_apply_fix (fixS * fixP, 1 of the base address. */ value = (value + 1) & ~ 1; - if ((value & ~0x3fffff) && ((value & ~0x3fffff) != ~0x3fffff)) - { - if (!(ARM_CPU_HAS_FEATURE (cpu_variant, arm_arch_t2))) - as_bad_where (fixP->fx_file, fixP->fx_line, BAD_RANGE); - else if ((value & ~0x1ffffff) - && ((value & ~0x1ffffff) != ~0x1ffffff)) - as_bad_where (fixP->fx_file, fixP->fx_line, - _("Thumb2 branch out of range")); - } + if ((value & ~0x3fffff) && ((value & ~0x3fffff) != ~0x3fffff)) + { + if (!(ARM_CPU_HAS_FEATURE (cpu_variant, arm_arch_t2))) + as_bad_where (fixP->fx_file, fixP->fx_line, BAD_RANGE); + else if ((value & ~0x1ffffff) + && ((value & ~0x1ffffff) != ~0x1ffffff)) + as_bad_where (fixP->fx_file, fixP->fx_line, + _("Thumb2 branch out of range")); + } if (fixP->fx_done || !seg->use_rela_p) encode_thumb2_b_bl_offset (buf, value); |