From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26183 invoked by alias); 4 Nov 2004 14:19:24 -0000 Mailing-List: contact binutils-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sources.redhat.com Received: (qmail 26156 invoked from network); 4 Nov 2004 14:19:21 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 4 Nov 2004 14:19:21 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1CPiSM-0004VF-5C; Thu, 04 Nov 2004 09:19:18 -0500 Date: Thu, 04 Nov 2004 14:19:00 -0000 From: Daniel Jacobowitz To: Richard Earnshaw Cc: Ian Lance Taylor , Paul Brook , binutils@sources.redhat.com Subject: Re: [arm] EABI annotation of thumb symbols. Message-ID: <20041104141917.GA17140@nevyn.them.org> Mail-Followup-To: Richard Earnshaw , Ian Lance Taylor , Paul Brook , binutils@sources.redhat.com References: <200411021422.03537.paul@codesourcery.com> <1099406470.6939.15.camel@pc960.cambridge.arm.com> <20041102151243.GA19832@nevyn.them.org> <1099563644.6939.158.camel@pc960.cambridge.arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1099563644.6939.158.camel@pc960.cambridge.arm.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-11/txt/msg00073.txt.bz2 On Thu, Nov 04, 2004 at 10:20:44AM +0000, Richard Earnshaw wrote: > On Thu, 2004-11-04 at 01:54, Ian Lance Taylor wrote: > > Daniel Jacobowitz writes: > > > > > [This was one of the last open issues I had questions about before > > > posting the Thumb PLT patches I've mentioned before. I will try to do > > > that Really, Really Soon, like this afternoon.] > > > > I was thinking about Thumb PLT earlier. I can see how to get each PLT > > entry down to 8 bytes, but the linker would have to strew various > > branches across the PLT to get around the limited range of the Thumb > > branch instruction. Is that the type of thing you are doing? > > Don't do Thumb PLT's. The idea doesn't work. Yes. Sorry I was unclear; I meant "PLTs usable from Thumb". It could be done somewhat more efficiently than the way I did it for v5 (by editing branches in the input), but I just put Thumb-to-ARM stubs in the right place. Once the OABI code has been dealt with I'll post it, really. > 1) You don't know whether the target will be ARM or Thumb (it's > in another shared library which may not be the same at run time > as the one you link against at static link time -- don't forget > pre-emption). So the sequence has to end with an instruction > that can change instruction set state (on v4T that means bx). > > 2) You don't have enough registers to do a bx at the end of the > sequence and remember where you've come from (Needed for > re-entry into the dynamic linker, especially if you want to > continue to support pre-linking). To avoid this you end up > playing games that make the sequence as long as any ARM > equivalent -- and there are still problems. > > We concluded that the best solution on v4T chips was to insist that all > shared library functions were entered in ARM state (they can switch back > to Thumb internally); it the linker's job to create the proper entry > points when building a shared library. In libraries that will run on v5 > or later systems, the restriction can be lifted, since an ldr to the PC > can switch to Thumb state without problems. I've actually implemented the alternative suggested in a document someone (you? Phil?) posted to the EABI list at some point, in which GOT entries point back into the proper PLT stub. This supports entering shared libraries in Thumb mode on V4T. However, I'm quite willing to ditch that part of the patch, and try to implement generating ARM entry points instead. -- Daniel Jacobowitz