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 3C2133983A71 for ; Fri, 11 Sep 2020 18:34:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3C2133983A71 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 1F3273009852; Fri, 11 Sep 2020 20:34:19 +0200 (CEST) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id C7D164000F04; Fri, 11 Sep 2020 20:34:19 +0200 (CEST) Message-ID: <6479a8f716ee1f34c7812bc2afa4f5c3e4f06990.camel@klomp.org> Subject: Re: [PATCH] gas: Don't error when .debug_line already exists, unless .loc was used From: Mark Wielaard To: Nick Clifton Cc: "binutils@sourceware.org" Date: Fri, 11 Sep 2020 20:34:19 +0200 In-Reply-To: <24411cad-fc66-bca6-8122-f3580e2d26c2@redhat.com> References: <24411cad-fc66-bca6-8122-f3580e2d26c2@redhat.com> 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.8 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, KAM_LOTSOFHASH, KAM_SHORT, 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 18:34:22 -0000 Hi Nick, On Fri, 2020-09-11 at 16:45 +0100, Nick Clifton wrote: > > gas/ChangeLog: > >=20 > > * as.texi (-g): Explicitly mention when .debug_info and .debug_line > > are generated for the DWARF format. > > (Loc): Add that it is an error to both use a .loc directive and > > generate a .debug_line yourself. > > * dwarf2dbg.c (dwarf2_any_loc_directive_seen): New static variable. > > (dwarf2_directive_loc): Set dwarf2_any_loc_directive_seen to TRUE. > > (dwarf2_finish): Check dwarf2_any_loc_directive_seen before emittin= g > > an error. Only create .debug_line if it is empty (or doesn't exist)= . > > * testsuite/gas/i386/i386.exp: Add dwarf2-line-{1,2,3,4} when testi= ng > > an elf target. > > * testsuite/gas/i386/dwarf2-line-{1,2,3,4}.{s,d,l}: New test files. >=20 > Approved - please apply. Thanks, pushed as commit edc7a80. > If you are feeling keen, then do please have a go at creating a > generic testcase. If not, then I will make one myself soon. Jakub was already working on one to be used as configure test for gcc: https://gcc.gnu.org/pipermail/gcc-patches/2020-September/553586.html Once we have something that works I'll make sure to submit something similar to the gas testsuite to make sure things keep working. Which brings me to another request. This patch (and some of the other dwarf5 fixes) as pre-requirements for passing --gdwarf-5 to gas from gcc to get full DWARF5 support. Would it be possible to backport these to the 2.35 branch so that it can be used with bintuils 2.35.1? commit 19d80e5fec548e681c453d15b4ae5b49bc080acc bfd: Handle DW_FORM_data16 for .debug_line tables containing MD5 commit c3757b583d2448a5996e83e374fb96ac7938da35 Fix the linker's handling of DWARF-5 line number tables. commit 4a5700b62f767ed08c97122bad182244700bb4e3 gas: Handle bad -gdwarf options, just like bad --gdwarf options. commit dd216e07a156c19e589fc5f481fe13a256262801 gas: Use DW_FORM_sec_offset for DWARF version 4 or higher. commit b0b3ea7e10443f211267babcac99ac6677d593ce gas: Make sure to only add an md5 to a .file when requested. commit bdd3b953e24c3d2bc55e06e30e0ef5e0ff829e3f gas: Output .debug_rnglists for DWARF 5. commit d2a54558074287721ce9e47142f7fa92bda15531 gas: Output directory and file names in .debug_line_str for DWARF5 commit edc7a80a9c04667dfa74f90f74bd39827bc372b7 gas: Don't error when .debug_line already exists, unless .loc was used I can do the backports myself if you tell me how. Thanks, Mark