linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: ard.biesheuvel@linaro.org (Ard Biesheuvel)
To: linux-arm-kernel@lists.infradead.org
Subject: your mail
Date: Tue, 21 Apr 2015 16:06:02 +0200	[thread overview]
Message-ID: <CAKv+Gu_KsgBau8f8ZmUpBZmD4chmRsD2126LcN5qeNEwcJH+oQ@mail.gmail.com> (raw)
In-Reply-To: <20150421135552.GX12732@n2100.arm.linux.org.uk>

On 21 April 2015 at 15:55, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Tue, Apr 21, 2015 at 02:18:03PM +0100, Dave P Martin wrote:
>> On Tue, Apr 21, 2015 at 01:50:50PM +0100, Russell King - ARM Linux wrote:
>> > On Tue, Apr 21, 2015 at 12:24:20PM +0100, Russell King - ARM Linux wrote:
>> > > We should probably create a badr macro to complement the adr pseudo-op
>> > > which incorporates the BSYM thing so make this clearer - and a comment
>> > > before it.  This is really the case where BSYM should be used.
>> >
>> > Something like this.  Note that I've also removed the BSYM() usage in
>> > the KVM code.
>>
>> Nice.  Wrapping this around adr will make the assembler check that it's
>> not a cross-section reference too.
>
> While looking at this, I've become very upset with our toolchain's
> abilities.  This is with stock binutils 2.22-2.25, and Ard's suggestion
> for using blx:
>
> 00000000 <secondary_startup_arm>:
>    0:   fafffffe        blx     4 <secondary_startup>
>
> 00000004 <secondary_startup>:
>    4:   f7ff fffe       bl      0 <__hyp_stub_install_secondary>
>    8:   f3ef 8900       mrs     r9, CPSR
>    c:   f089 091a       eor.w   r9, r9, #26
>   10:   f019 0f1f       tst.w   r9, #31
>
> That's fine, but now if we look at the .head.text section (I also added
> an ENTRY(start) to try and solve this):
>
> 00000000 <stext>:
>    0:   ffff faff                       ; <UNDEFINED> instruction: 0xfffffaff
>
> 00000004 <start>:
>    4:   fffef7ff        .word   0xfffef7ff
>    8:   f3ef 8900       mrs     r9, CPSR
>    c:   091af089        .word   0x091af089
>   10:   f019 0f1f       tst.w   r9, #31
>   14:   091ff029        .word   0x091ff029
>   18:   09d3f049        .word   0x09d3f049
>   1c:   f049 0920       orr.w   r9, r9, #32
>   20:   f449d109        .word   0xf449d109
>   24:   f20f7980        .word   0xf20f7980
>   28:   0e13            lsrs    r3, r2, #24
>   2a:   f399            .short  0xf399
>   2c:   8f00            ldrh    r0, [r0, #56]   ; 0x38
>   2e:   f38e            .short  0xf38e
>   30:   f3de8e30        .word   0xf3de8e30
>   34:   8f00            .short  0x8f00
>   36:   f389 8100       msr     CPSR_c, r9
>
> readelf for this shows for section 5:
>
> Section Headers:
>   [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
>   [ 5] .head.text        PROGBITS        00000000 000290 000254 00  AX  0   0  4
> ...
>    Num:    Value  Size Type    Bind   Vis      Ndx Name
>      4: 00000000     0 SECTION LOCAL  DEFAULT    5
>      5: 00000000     0 NOTYPE  LOCAL  DEFAULT    5 $a
>      6: 00000004     0 NOTYPE  LOCAL  DEFAULT    5 $t
>      7: 0000002e     0 NOTYPE  LOCAL  DEFAULT    5 $d
>      8: 00000036     0 NOTYPE  LOCAL  DEFAULT    5 $t
> ...
>     65: 00000000     4 FUNC    GLOBAL DEFAULT    5 stext
>     66: 00000005   122 FUNC    GLOBAL DEFAULT    5 start
>
> One has to wonder about the toolchain when the stupid $[adt] hack seems
> to be going soooo wrong.
>
> I think I'm going to stop working on this until we have a toolchain
> which behaves sensibly... when you can't get the damned thing to
> disassemble for confirmation purposes, its best to leave the damned
> code alone.
>

It indeed seems to be objdump that is failing, but the code itself
looks fine to me.  For the record, binutils v2.23.52 works fine

  reply	other threads:[~2015-04-21 14:06 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 10:18 No subject Ard Biesheuvel
2015-04-21 10:46 ` your mail Dave P Martin
2015-04-21 10:50   ` Ard Biesheuvel
2015-04-21 11:10     ` Dave P Martin
2015-04-21 11:15       ` Ard Biesheuvel
2015-04-21 11:24       ` Russell King - ARM Linux
2015-04-21 12:50         ` Russell King - ARM Linux
2015-04-21 13:10           ` Ard Biesheuvel
2015-04-21 13:21             ` Dave P Martin
2015-04-21 13:28               ` Ard Biesheuvel
2015-04-21 15:51                 ` Dave Martin
2015-04-21 14:05               ` Russell King - ARM Linux
2015-04-21 13:18           ` Dave P Martin
2015-04-21 13:55             ` Russell King - ARM Linux
2015-04-21 14:06               ` Ard Biesheuvel [this message]
2015-04-21 17:03                 ` Dave Martin
     [not found] <20191026192359.27687-1-frank-w@public-files.de>
2019-10-26 19:30 ` Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2017-06-04 11:59 No subject Yury Norov
2017-06-14 20:16 ` your mail Yury Norov
2014-10-28 14:13 No subject Mark Rutland
2014-10-28 14:19 ` your mail Mark Rutland
2012-06-21 18:26 No subject Paul Walmsley
2012-06-22  8:56 ` your mail Tony Lindgren
2011-12-02 16:01 No subject Will Deacon
2011-12-02 16:11 ` your mail Will Deacon
2011-05-13 19:35 No subject Vadim Bendebury
2011-05-14  3:32 ` your mail Jean-Christophe PLAGNIOL-VILLARD
2010-06-07 17:58 No subject Dave Hylands
2010-06-07 22:10 ` your mail Jamie Lokier
2010-06-07 22:44   ` Dave Hylands
2010-05-18 10:38 No subject Marek Szyprowski
2010-05-19  2:24 ` your mail Ben Dooks
     [not found] <1250258343-14203-1-git-send-email-thierry.reding@avionic-design.de>
2009-10-02 14:53 ` Thierry Reding
2010-01-02 12:06   ` Russell King - ARM Linux

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=CAKv+Gu_KsgBau8f8ZmUpBZmD4chmRsD2126LcN5qeNEwcJH+oQ@mail.gmail.com \
    --to=ard.biesheuvel@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).