This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix Thumb gas segfault


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]