From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3458 invoked by alias); 18 Apr 2006 15:45:27 -0000 Received: (qmail 3444 invoked by uid 22791); 18 Apr 2006 15:45:26 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 18 Apr 2006 15:45:24 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FVsOC-0003mO-1K; Tue, 18 Apr 2006 11:45:16 -0400 Date: Tue, 18 Apr 2006 15:49:00 -0000 From: Daniel Jacobowitz To: Richard Earnshaw Cc: johnmc@sidsa.es, binutils@sources.redhat.com Subject: Re: plt for arm gnu thumb Message-ID: <20060418154515.GA13751@nevyn.them.org> Mail-Followup-To: Richard Earnshaw , johnmc@sidsa.es, binutils@sources.redhat.com References: <4385.195.53.86.158.1145361498.squirrel@webmail> <1145373227.14054.16.camel@pc960.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1145373227.14054.16.camel@pc960.cambridge.arm.com> User-Agent: Mutt/1.5.8i Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00232.txt.bz2 On Tue, Apr 18, 2006 at 04:13:47PM +0100, Richard Earnshaw wrote: > There's only ever going to be a problem if you try to run on an > Architecture v4T device. These chips cannot transition to Thumb mode > when loading a PC value from memory, but need instead to use a BX > instruction. The problem is that for a shared library trampoline we > need to: > > - preserve all of r0-r11, r13 and r14 > - have the 'index' of the called function in ip > > There's simply no way to achieve all that efficiently and support proper > interworking on these devices. (v5 and later chips can swap from ARM to > Thumb on a load into the PC, so there is no problem there). > > We investigated this quite thoroughly as part of the EABI development. > We concluded that given that the standard trampoline would work on all > v4 and earlier chips and all v5 or later chips (ie everything but v4T), > and that on v4T the sequence works if the target of the call is entered > in ARM state, the best solution overall was to mandate that on a v4T > device, the called address must be an ARM instruction (it can transition > to Thumb state immediately thereafter). > > In theory this could all be handled by the linker when constructing the > library, but currently the GNU linker does not do this. Oh, right; I forgot about this issue. I did once implement alternate PLT sequences which could target Thumb, even on v4t. However, they are mighty awkward, so I would strongly prefer not to submit the patch. John, are you really using v4t? -- Daniel Jacobowitz CodeSourcery