public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Fix Thumb gas segfault
@ 2007-03-24 16:14 Paul Brook
  0 siblings, 0 replies; only message in thread
From: Paul Brook @ 2007-03-24 16:14 UTC (permalink / raw)
  To: binutils

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)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-03-24 16:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-24 16:14 Fix Thumb gas segfault Paul Brook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).