public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Julian Brown <julian@codesourcery.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: Richard Earnshaw <rearnsha@gcc.gnu.org>,
	 binutils@sources.redhat.com,
	 Julian Brown <julian@codesourcery.com>
Subject: Re: [PATCH] Fix thumb calls via PLT on ARM/SymbianOS
Date: Wed, 16 Mar 2005 16:10:00 -0000	[thread overview]
Message-ID: <42384770.8030104@codesourcery.com> (raw)
In-Reply-To: <20050316144218.GA27174@nevyn.them.org>

Daniel Jacobowitz wrote:
> On Wed, Mar 16, 2005 at 02:23:12PM +0000, Richard Earnshaw wrote:
> 
>>On Wed, 2005-03-16 at 14:17, Julian Brown wrote:
>>
>>>Hi,
>>>
>>>This patch fixes calls made from thumb mode via the PLT on SymbianOS. 
>>>PLT entries are written in ARM mode, but previously they were being 
>>>called in thumb mode, with their address incorrectly offset by -4 
>>>(PLT_THUMB_STUB_SIZE).
>>>
>>>Now, the target address has been corrected and the thumb BL instruction 
>>>is rewritten as BLX to perform the mode switch before attempting to 
>>>execute the PLT entry. (BLX is an armv5t instruction, but as SymbianOS 
>>>is only targeted at armv5t+, this should always be OK.)
>>>
>>>The hardwired "4" for the thumb stub size on non-SymbianOS targets has 
>>>also been rewritten as PLT_THUMB_STUB_SIZE.
>>>
>>>OK to apply?
>>
>>This sounds like a hack.  I'd much rather a generic solution were found
>>(and which permitted the blx optimization if available).
> 
> 
> The SymbianOS bits sound generally right to me.  The fact that the -4
> bias is currently included is just a bug; that's from the code to
> generate a Thumb header on PLT entries, which is already disabled
> for SymbianOS.
> 
> OTOH, it may be missing some error checks - what if it's _not_ a BL? 
> Could we reach here?

I assumed not: this is an R_ARM_THM_PC22, alias R_ARM_THM_CALL 
relocation. Can that sensibly point at anything else?

Would it be better to add a --target-arch (or something) flag to 
binutils at this point? That would tidy up a previous patch of mine, 
too. I don't know if any other targets have, or need, such an option.

Julian

  reply	other threads:[~2005-03-16 14:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-16 14:52 Julian Brown
2005-03-16 14:56 ` Richard Earnshaw
2005-03-16 15:27   ` Daniel Jacobowitz
2005-03-16 16:10     ` Julian Brown [this message]
2005-03-16 16:29       ` Richard Earnshaw
2005-03-16 16:34         ` Julian Brown
2005-03-16 16:42       ` Ian Lance Taylor
2005-03-16 16:54         ` Richard Earnshaw
2005-03-16 17:16           ` Ian Lance Taylor
2005-03-16 17:34             ` Richard Earnshaw
2005-03-16 22:00               ` Ian Lance Taylor
2005-03-17  0:13                 ` Richard Earnshaw
2005-03-18 19:59                   ` Julian Brown
2005-03-17 20:58           ` [PATCH] Fix thumb calls via PLT on ARM/SymbianOS (rfc) Julian Brown
2005-03-17 21:03             ` Question! NK
2005-03-23 20:11               ` Question! Nick Clifton
2005-03-17 21:25             ` [PATCH] Fix thumb calls via PLT on ARM/SymbianOS (rfc) Paul Brook
2005-03-16 16:16     ` [PATCH] Fix thumb calls via PLT on ARM/SymbianOS Richard Earnshaw

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42384770.8030104@codesourcery.com \
    --to=julian@codesourcery.com \
    --cc=binutils@sources.redhat.com \
    --cc=drow@false.org \
    --cc=rearnsha@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).