public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Jose E. Marchesi" <jose.marchesi@oracle.com>
To: Nick Clifton <nickc@redhat.com>
Cc: Nick Clifton via Binutils <binutils@sourceware.org>,
	David Faust <david.faust@oracle.com>
Subject: Re: Commit: Gas: Add .nop directive.
Date: Tue, 15 Sep 2020 13:57:35 +0200	[thread overview]
Message-ID: <87pn6n5k28.fsf@oracle.com> (raw)
In-Reply-To: <66993ade-f84c-5f7a-86e8-a1dd017f38b5@redhat.com> (Nick Clifton's message of "Tue, 15 Sep 2020 12:13:06 +0100")


>> In the same spirit, it would be awesome to be able to generate
>> architecture-neutral data directives as well, for DWARF and CTF and the
>> like :)
>
> What about ".dc.b <val>" ?  Does that not work for all targets ?

Maybe it does.

We found problems while trying to have .s files in CTF tests in ld,
generated with a patched GCC: the data directives emitted by the
compiler are architecture-specific.  I think the GDB testsuite ships
with a DWARF assembler because of the same reason.

So I guess the problem is more a compiler one... i.e. what data
directives it uses.

>>> +#define md_single_noop_insn "mov %r1,%r1"
>> 
>> For BPF we have this in GCC:
>> 
>> (define_insn "nop"
>>   [(const_int 0)]
>>   ""
>>   "mov\t%%r0,%%r0"
>
>> I think it would be good to settle on the same way to encode nops in
>> both GCC and binutils.
>
> Actually David Faust just posted a patch to change the instruction to "ja 0"
> as this is what the kernel expects.  I have applied his patch to gas.  Maybe
> gcc should be updated as well ?

Yeah, actually it was your patch that prompted us to revisit the NOP
situation in BPF, and we found out the kernel actually expects a
particular encoding for them.  So thanks for that :)

We fixed GCC as well.

  reply	other threads:[~2020-09-15 11:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-14 15:13 Nick Clifton
2020-09-14 15:27 ` Jose E. Marchesi
2020-09-15 11:13   ` Nick Clifton
2020-09-15 11:57     ` Jose E. Marchesi [this message]
2020-09-14 15:38 ` Andreas Schwab
2020-09-14 16:02   ` Nick Clifton
2020-09-30 18:18 ` Maciej W. Rozycki
     [not found] <mailman.151032.1600097231.8982.binutils@sourceware.org>
2020-09-14 16:04 ` Michael Morrell
2020-09-14 16:31   ` Nick Clifton
2020-09-15  9:53     ` Nick Clifton

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=87pn6n5k28.fsf@oracle.com \
    --to=jose.marchesi@oracle.com \
    --cc=binutils@sourceware.org \
    --cc=david.faust@oracle.com \
    --cc=nickc@redhat.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.
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).