From owner-freebsd-mips@FreeBSD.ORG Fri Oct 21 07:13:41 2011 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E6AC106566B for ; Fri, 21 Oct 2011 07:13:41 +0000 (UTC) (envelope-from juli@clockworksquid.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 1D9448FC16 for ; Fri, 21 Oct 2011 07:13:40 +0000 (UTC) Received: by wyi40 with SMTP id 40so4699861wyi.13 for ; Fri, 21 Oct 2011 00:13:40 -0700 (PDT) Received: by 10.227.179.76 with SMTP id bp12mr2475424wbb.82.1319181220177; Fri, 21 Oct 2011 00:13:40 -0700 (PDT) MIME-Version: 1.0 Sender: juli@clockworksquid.com Received: by 10.227.199.140 with HTTP; Fri, 21 Oct 2011 00:13:20 -0700 (PDT) In-Reply-To: References: From: Juli Mallett Date: Fri, 21 Oct 2011 00:13:20 -0700 X-Google-Sender-Auth: i20Tm7kv4LHYy0tEYupy2PcZad4 Message-ID: To: Rohit J Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-mips Subject: Re: Assembler complains about use of $at after ".set noat" on sd instr X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Oct 2011 07:13:41 -0000 On Thu, Oct 20, 2011 at 23:38, Rohit J wrote: > Hi FreeBSD MIPS Gurus, > > Am just starting on MIPS assembly in FreeBSD. > > The code that I have was building just fine. > Then I added an line to a .S file @line# 513 > > =C2=A0 =C2=A0 sd =C2=A0k0, mpl(sp) > > which on make gives an error that says : > > =C2=A0Assembler messages: > octeon_asm.S:440: Error: illegal operands `ld T3,8($7)' > octeon_asm.S:513: Error: Macro used $at after ".set noat" > > The .S file has a noat directive > =C2=A0.set noat > > Silly Questions > 1. =C2=A0 =C2=A0 =C2=A0Why does sd instruction (store double word) end up= using at ? > I checked the particular manual (Cavium Octeon H/w reference Manual) > and didn=E2=80=99t find anything about sd instr using register at. Probably you are using a symbol/macro that is not locally defined, and so assembler assumes it's an external data reference, and tries to turn sd into a series of instructions using the assembler temporary to load a linker-resolved address into a register to be used in the sd instruction. Try running just the C preprocessor and looking at the resulting assembly to see what's not being resolved properly. > 2. =C2=A0 =C2=A0 =C2=A0Why does it complain about ld instr so far up in t= he file away from > the place > new code was inserted? Can you send the source inline? I suspect you're missing an include or something. Did you change that line? Are you compiling it as it's built on stock FreeBSD, or are you, say, copying the file from the kernel and then trying to build it in userland?