From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 40009 invoked by alias); 5 Jan 2017 14:22:00 -0000 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 Received: (qmail 39790 invoked by uid 89); 5 Jan 2017 14:21:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 spammy=jiong.wang@foss.arm.com, jiongwangfossarmcom X-HELO: prv-mh.provo.novell.com Received: from prv-mh.provo.novell.com (HELO prv-mh.provo.novell.com) (137.65.248.74) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 05 Jan 2017 14:21:49 +0000 Received: from INET-PRV-MTA by prv-mh.provo.novell.com with Novell_GroupWise; Thu, 05 Jan 2017 07:21:46 -0700 Message-Id: <586E648A020000780012D714@prv-mh.provo.novell.com> Date: Thu, 05 Jan 2017 14:22:00 -0000 From: "Jan Beulich" To: "Jiong Wang" Cc: "Szabolcs Nagy" , "Rich Felker" , "Reiner Herrmann" , "Binutils" Subject: Re: [ARM] Allow MOV/MOV.W to accept all possible immediates References: <27959ba0-3b6f-185d-1c8b-55a28d7e286c@foss.arm.com> <586E23CD.7030903@arm.com> <586E24A6.2020606@arm.com> In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-SW-Source: 2017-01/txt/msg00085.txt.bz2 >>> On 05.01.17 at 14:59, wrote: > On 05/01/17 10:49, Szabolcs Nagy wrote: >> On 05/01/17 10:45, Szabolcs Nagy wrote: >>> $ cat bug.s >>> .syntax unified >>> .text >>> .arch armv7-a >>> mov r3,#1 >>> >>> .arch armv4t >>> .eabi_attribute 6,2 >>> bx lr >>> >>> $ arm-none-linux-gnueabihf-as -mthumb bug.s >>> bug.s: Assembler messages: >>> bug.s:4: Error: invalid constant (1) after fixup >>> >>> previously this worked, but i'm not sure if the mix >>> of .arch directives and .syntax unified is valid here. >=20 > It looks to me the failure is caused by the second ".arch armv4t"=20 > overrides the > first ".arch armv7-a", therefore the arch feature is lowerd to armv4t in > assembler fixup stage. While "mov r3, #1" under thumb mode is only allow= ed > with ARMv6T2. >=20 > This patch tightend the check from >=20 > if (fixP->fx_r_type =3D=3D BFD_RELOC_ARM_T32_IMMEDIATE > || fixP->fx_r_type =3D=3D BFD_RELOC_ARM_T32_ADD_IMM) >=20 > into: >=20 > if ((fixP->fx_r_type =3D=3D BFD_RELOC_ARM_T32_IMMEDIATE > && ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v6t2)) > || fixP->fx_r_type =3D=3D BFD_RELOC_ARM_T32_ADD_IMM) >=20 >=20 > thus the sequences in bug.s is not allowed. Suggests pretty clearly that the fixup should record the arch in use at the time it is being created. Jan