[PATCH] gas: Don't error when .debug_line already exists, unless .loc was used
Mark Wielaard
mark@klomp.org
Fri Sep 11 15:46:14 GMT 2020
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
More information about the Binutils
mailing list