Fix Thumb gas segfault
Paul Brook
paul@codesourcery.com
Sat Mar 24 16:14:00 GMT 2007
The ARM non-unified assembler assumes that Thumb ldm/stm always use the ia
addressing mode. Other addressing modes are only available on Thumb-2, and
you're supposed to use unified mode for that.
The patch below makes gas issue an appropriate error rather than segfaulting
on the 32-bit encodings.
Tested with cross to arm-none-eabi.
Applied to head.
Paul
2007-03-24 Paul Brook <paul@codesourcery.com>
* config/tc-arm.c (do_t_ldmstm): Error on Thumb-2 addressing modes.
Index: gas/config/tc-arm.c
===================================================================
--- gas/config/tc-arm.c (revision 166694)
+++ gas/config/tc-arm.c (working copy)
@@ -9121,6 +9136,9 @@ do_t_ldmstm (void)
{
constraint (inst.operands[0].reg > 7
|| (inst.operands[1].imm & ~0xff), BAD_HIREG);
+ constraint (inst.instruction != T_MNEM_ldmia
+ && inst.instruction != T_MNEM_stmia,
+ _("Thumb-2 instruction only valid in unified syntax"));
if (inst.instruction == T_MNEM_stmia)
{
if (!inst.operands[0].writeback)
More information about the Binutils
mailing list