linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: dave.martin@linaro.org (Dave Martin)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH REPOST] ARM: Thumb-2: Relax relocation requirements for non-function symbols
Date: Wed, 1 Jun 2011 11:48:42 +0100	[thread overview]
Message-ID: <20110601104842.GA24856@arm.com> (raw)
In-Reply-To: <BANLkTi=i-ck69zWrM1bgnsUDw4GRvmxEYg@mail.gmail.com>

On Wed, Jun 01, 2011 at 10:27:14AM +0100, Catalin Marinas wrote:
> On 31 May 2011 17:27, Dave Martin <dave.martin@linaro.org> wrote:
> > The "Thumb bit" of a symbol is only really meaningful for function
> > symbols (STT_FUNC).
> >
> > However, sometimes a branch is relocated against a non-function
> > symbol; for example, PC-relative branches to anonymous assembler
> > local symbols are typically fixed up against the start-of-section
> > symbol, which is not a function symbol. ?Some inline assembler
> > generates references of this type, such as fixup code generated by
> > macros in <asm/uaccess.h>.
> >
> > The existing relocation code for R_ARM_THM_CALL/R_ARM_THM_JUMP24
> > interprets this case as an error, because the target symbol appears
> > to be an ARM symbol; but this is really not the case, since the
> > target symbol is just a base in these cases. ?The addend defines
> > the precise offset to the target location, but since the addend is
> > encoded in a non-interworking Thumb branch instruction, there is no
> > explicit Thumb bit in the addend. ?Because these instructions never
> > interwork, the implied Thumb bit in the addend is 1, and the
> > destination is Thumb by definition.
> >
> > This patch removes the extraneous Thumb bit check for non-function
> > symbols, enabling modules containing the affected relocation types
> > to be loaded. ?No modification to the actual relocation code is
> > required, since this code does not take bit[0] of the
> > location->destination offset into account in any case.
> >
> > Function symbols are always checked for interworking conflicts, as
> > before.
> >
> > Signed-off-by: Dave Martin <dave.martin@linaro.org>
> 
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>

Thanks
---Dave

  reply	other threads:[~2011-06-01 10:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-31 16:27 [PATCH REPOST] ARM: Thumb-2: Relax relocation requirements for non-function symbols Dave Martin
2011-06-01  9:27 ` Catalin Marinas
2011-06-01 10:48   ` Dave Martin [this message]
2011-06-01 13:04 ` Tixy
2011-06-01 15:23   ` Dave Martin

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=20110601104842.GA24856@arm.com \
    --to=dave.martin@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.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 NNTP newsgroup(s).