mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: musl@lists.openwall.com
Cc: Andre McCurdy <armccurdy@gmail.com>
Subject: Re: [PATCH] arm: avoid conditional branch to PLT in sigsetjmp.s
Date: Wed, 18 Sep 2019 07:28:44 -0700	[thread overview]
Message-ID: <CAMKF1srDwhkx++8WOKwtsu8NSwHXkA-29_wf0=yAe8o5Y=dUuw@mail.gmail.com> (raw)
In-Reply-To: <20190918060405.17630-1-armccurdy@gmail.com>

On Tue, Sep 17, 2019 at 11:04 PM Andre McCurdy <armccurdy@gmail.com> wrote:
>
> The R_ARM_THM_JUMP19 relocation type generated for the original code
> when targeting Thumb 2 is not supported by the gold linker:
>
>  | .../arm-oe-linux-musleabi/9.2.0/ld: error: conditional branch to PLT in THUMB-2 not supported yet.
>  | src/signal/arm/sigsetjmp.s:9: error: unexpected opcode while processing relocation R_ARM_THM_JUMP19

if it is thumb2 specific another option could be to use `it eq` before
beq which should turn branch into an unconditional branch, which then
uses R_ARM_THM_JUMP24 relocation that has a range of 16MB.

> ---
>  src/signal/arm/sigsetjmp.s | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/src/signal/arm/sigsetjmp.s b/src/signal/arm/sigsetjmp.s
> index 318addba..69ebbf49 100644
> --- a/src/signal/arm/sigsetjmp.s
> +++ b/src/signal/arm/sigsetjmp.s
> @@ -6,9 +6,10 @@
>  sigsetjmp:
>  __sigsetjmp:
>         tst r1,r1
> -       beq setjmp
> +       bne 1f
> +       b setjmp
>
> -       str lr,[r0,#256]
> +1:     str lr,[r0,#256]
>         str r4,[r0,#260+8]
>         mov r4,r0
>
> --
> 2.23.0
>


  reply	other threads:[~2019-09-18 14:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18  6:04 Andre McCurdy
2019-09-18 14:28 ` Khem Raj [this message]
2019-09-18 17:52   ` Andre McCurdy
2019-09-18 19:54     ` Rich Felker
2019-11-21 20:54       ` Andre McCurdy
2019-12-07 18:03         ` Rich Felker

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='CAMKF1srDwhkx++8WOKwtsu8NSwHXkA-29_wf0=yAe8o5Y=dUuw@mail.gmail.com' \
    --to=raj.khem@gmail.com \
    --cc=armccurdy@gmail.com \
    --cc=musl@lists.openwall.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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).