Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760533AbbKTSPh (ORCPT ); Fri, 20 Nov 2015 13:15:37 -0500 Received: from mailapp01.imgtec.com ([195.59.15.196]:12535 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759590AbbKTSPg (ORCPT ); Fri, 20 Nov 2015 13:15:36 -0500 Date: Fri, 20 Nov 2015 18:15:32 +0000 From: "Maciej W. Rozycki" To: Matthew Fortune CC: Alex Smith , Markos Chandras , linux-mips , Alex Smith , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH 1/3] MIPS: Initial implementation of a VDSO In-Reply-To: <6D39441BF12EF246A7ABCE6654B023532128FCAD@LEMAIL01.le.imgtec.org> Message-ID: References: <1443434629-14325-1-git-send-email-markos.chandras@imgtec.com> <1443435011-17061-1-git-send-email-markos.chandras@imgtec.com> <6D39441BF12EF246A7ABCE6654B023532128FCAD@LEMAIL01.le.imgtec.org> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [10.100.200.53] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1859 Lines: 45 On Mon, 28 Sep 2015, Matthew Fortune wrote: > > > + /* lapc is an alias to addiupc reg, - . > > > + * > > > + * We can't use addiupc because there is no label-label > > > + * support for the addiupc reloc > > > + */ > > > + __asm__("lapc %0, _start \n" > > > + : "=r" (addr) : :); > > > > Just curious - if lapc is just an alias to addiupc, why does that work > > but not addiupc? IIRC I did try addiupc previously but removed it > > because it wasn't working, didn't know about lapc! > > This is just an unfortunate quirk of how the implementation is done in > binutils. We don't recognise the special case that: > > addiupc , - . > > is the same as > > lapc , > > And therefore don't know that we can just use the MIPS_PC19_S2 reloc > (name of that reloc may not be perfectly correct). It is a special > case as the RHS of the expression in ADDIUPC above can be theoretically > anything so we only support assembly time constants with addiupc. > > Apart from the need to document the LAPC alias somewhere I'm not sure > we need do anything to improve addiupc itself particularly. For the record -- this corresponds to how the LA macro and the PC-relative ADDIU instruction are handled when assembling MIPS16 code. And the place to document such peculiarities is obviously an assembly language manual. A few have been written for the MIPS architecture already and with recent updates to the instruction set perhaps it is time for a revised edition or yet another book. Maciej -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/