public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Mark Wielaard <mark@klomp.org>
To: "H.J. Lu" <hjl.tools@gmail.com>, Nick Clifton <nickc@redhat.com>
Cc: "binutils@sourceware.org" <binutils@sourceware.org>
Subject: Re: [PATCH] gas: Don't error when .debug_line already exists, unless .loc was used
Date: Fri, 11 Sep 2020 17:46:14 +0200	[thread overview]
Message-ID: <0c5882b0b1ffae2668f54ff53e9cd6b3898e4680.camel@klomp.org> (raw)
In-Reply-To: <CAMe9rOrgKDa4Qppscd6_tK4kCsNSzwj13N4PP-hSCNwbc-jc2Q@mail.gmail.com>

On Fri, 2020-09-11 at 06:51 -0700, H.J. Lu wrote:
> On Fri, Sep 11, 2020 at 5:48 AM Nick Clifton via Binutils
> <binutils@sourceware.org> wrote:
> > > The tests are unfortunately arch specific because the line table
> > > is only
> > > generated when actual instructions have been emitted.
> > 
> > Are you sure about that ?  How about using the NOP instruction ?
> > 
> > I admit that some architectures do need special syntax for their
> > nop instructions, but there is already a test in gas testsuite
> > that handles this (see gas/testsuite/gas/all/gas.exp:org-1).  The
> > nop-selecting code there could probably be extracted into a library
> > function then used in lots of places...
> 
> 7.66 '.nops SIZE[, CONTROL]'
> ============================
> 
> This directive emits SIZE bytes filled with no-op instructions.  SIZE
> is
> absolute expression, which must be a positve value.  CONTROL controls
> how no-op instructions should be generated.  If the comma and CONTROL
> are omitted, CONTROL is assumed to be zero.

O nice. Somewhat embarrassingly I hadn't seen that because I was using
the online documentation: 
https://sourceware.org/binutils/docs/as/Pseudo-Ops.html

Which I now realize is not current. Oops. Can someone (I?) update that?

Sadly .nops does produce one or more architecture specific nop
instructions, but does not result in a call to dwarf2_emit_insn like
real instructions. So it looks like I still need to use the
gas.exp:org-1 trick.

Or is it a bug that .nops doesn't trigger a call to dwarf2_imit_insn?

Another issue is that at least NEWS claims:

* Add support for .nops directive.  It is currently supported only for
  x86 targets.

Is that still true? If it isn't supported generically, it isn't really
that useful.

Thanks,

Mark

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

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-11 12:47 Nick Clifton
2020-09-11 13:51 ` H.J. Lu
2020-09-11 15:40   ` Nick Clifton
2020-09-11 15:46   ` Mark Wielaard [this message]
2020-09-11 15:56     ` Nick Clifton
2020-09-14 15:17     ` Nick Clifton
  -- strict thread matches above, loose matches on Subject: below --
2020-09-11 15:45 Nick Clifton
2020-09-11 18:34 ` Mark Wielaard
2020-09-14  9:45   ` Nick Clifton
2020-09-14 22:43     ` Mark Wielaard
2020-08-26 21:37 Duplicate .debug_lines (Was: [PATCH 5/5] Add --gdwarf-5 to ASM_SPEC) Mark Wielaard
2020-09-07 12:37 ` [PATCH] gas: Don't error when .debug_line already exists, unless .loc was used Mark Wielaard

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=0c5882b0b1ffae2668f54ff53e9cd6b3898e4680.camel@klomp.org \
    --to=mark@klomp.org \
    --cc=binutils@sourceware.org \
    --cc=hjl.tools@gmail.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).