public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: binutils@sourceware.org
Subject: Fix Thumb gas segfault
Date: Sat, 24 Mar 2007 16:14:00 -0000	[thread overview]
Message-ID: <200703241614.04925.paul@codesourcery.com> (raw)

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)

                 reply	other threads:[~2007-03-24 16:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200703241614.04925.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).