From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id 6FD0C385783D for ; Fri, 11 Sep 2020 15:46:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6FD0C385783D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mark@klomp.org Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 81E6B300160F; Fri, 11 Sep 2020 17:46:15 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id 20D734000F04; Fri, 11 Sep 2020 17:46:15 +0200 (CEST) Message-ID: <0c5882b0b1ffae2668f54ff53e9cd6b3898e4680.camel@klomp.org> Subject: Re: [PATCH] gas: Don't error when .debug_line already exists, unless .loc was used From: Mark Wielaard To: "H.J. Lu" , Nick Clifton Cc: "binutils@sourceware.org" Date: Fri, 11 Sep 2020 17:46:14 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-8.el7) Mime-Version: 1.0 X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Sep 2020 15:46:18 -0000 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 > wrote: > > > The tests are unfortunately arch specific because the line table > > > is only > > > generated when actual instructions have been emitted. > >=20 > > Are you sure about that ? How about using the NOP instruction ? > >=20 > > 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... >=20 > 7.66 '.nops SIZE[, CONTROL]' > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >=20 > 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:=20 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