From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26548 invoked by alias); 24 Mar 2007 16:14:12 -0000 Received: (qmail 26540 invoked by uid 22791); 24 Mar 2007 16:14:11 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 24 Mar 2007 16:14:09 +0000 Received: (qmail 15507 invoked from network); 24 Mar 2007 16:14:06 -0000 Received: from unknown (HELO 81-179-205-12.dsl.pipex.com) (paul@127.0.0.2) by mail.codesourcery.com with ESMTPA; 24 Mar 2007 16:14:06 -0000 From: Paul Brook To: binutils@sourceware.org Subject: Fix Thumb gas segfault User-Agent: KMail/1.9.5 MIME-Version: 1.0 Content-Disposition: inline Date: Sat, 24 Mar 2007 16:14:00 -0000 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200703241614.04925.paul@codesourcery.com> Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2007-03/txt/msg00354.txt.bz2 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 * 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)