From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by sourceware.org (Postfix) with ESMTPS id 3B3003858CDB for ; Fri, 30 Sep 2022 00:20:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3B3003858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-x1034.google.com with SMTP id bu5-20020a17090aee4500b00202e9ca2182so6334699pjb.0 for ; Thu, 29 Sep 2022 17:20:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date; bh=yiCKR4B9Q1Aw5YxdGD8hoZLvuxwEp9rn/Yj8jmn+abA=; b=K7TJ4+F4nQG6d5EzvZpaZjgo3yUkq+BYhuo6xfWdMY9m7DV5FUQCex5b5UxqjNj0gp V/cF3p8URBDT3sWJOV1ngMaxrNVgMAswoWs8Y0Lkf2OkIUtNWRgsVOljcc0PDtLRriXY mucLr2HqueZqQrqmkjRy7LoCQkRJE2povAfb6V4VnUmQbIRXJ/ALVJFLq3STuf6dsIEl bF5pBB5XzCDm7U24JMtNKBnFA/SzRKv5Z3I8RcSlkGLpX2T6eDLn9kkpx5Icn6YFgysT WB8tOdxHWDpwVHuf2VeS8buRqcIyU/0yEE8Rl037aDA3nJVPDgLLjKS59OMY/puvv+ps 48Kw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date; bh=yiCKR4B9Q1Aw5YxdGD8hoZLvuxwEp9rn/Yj8jmn+abA=; b=pYwgNDIslSUqcQLfDot5T53ccLKZbW9w4BsC2CFCCaENqQpyvZPJmlgT5pAQR6CY6Y kjeYVwhLvNN8wJEtElroi8WBGhmj2hqaPF7+KrjVDU90tPVQDOG4JJuVNgFTB8kmoh1E VJo1dM36V3VLjwvGQ0z+Z4sqBt3ivr18psDXcSQG94dhgQ1DQxMppUQYRFd4m53HHzjT 5auCYgMc5gKg5YnCmHNaeqy+WXPmx0AgfJemUUWUe9WKiMxRgBEAfZGLwzRFVJSv7Vzm VZ/w8/gIZvAcbJR7vtZY8+1j3qc4C4d5o+xoGEd2ltBD1l77zIze0a/0nULiKLvWHqal lDEg== X-Gm-Message-State: ACrzQf3XoTOuXfnkEsIeWULUWOExvLiLZKGVHUlP5QsGexrkrgzqvxEy DgZDlt+Ej5qECO35g6OJn0nRXZnOnHCKnw== X-Google-Smtp-Source: AMsMyM7VVhDmqPIRlR7li7OMex89H+R6a3meuifvSPM4HvsL7pkK7aCWK7Fpw9DbE0o01TASiEG9eg== X-Received: by 2002:a17:90b:3a85:b0:203:2044:c26 with SMTP id om5-20020a17090b3a8500b0020320440c26mr6597460pjb.109.1664497249734; Thu, 29 Sep 2022 17:20:49 -0700 (PDT) Received: from squeak.grove.modra.org ([2406:3400:51d:8cc0:ef77:99be:711e:8e79]) by smtp.gmail.com with ESMTPSA id g13-20020a170902e38d00b0017550eaa3eesm497062ple.71.2022.09.29.17.20.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Sep 2022 17:20:48 -0700 (PDT) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id 3A05D1142DF1; Fri, 30 Sep 2022 09:50:46 +0930 (ACST) Date: Fri, 30 Sep 2022 09:50:46 +0930 From: Alan Modra To: Martin =?utf-8?B?TGnFoWth?= Cc: binutils@sourceware.org Subject: Re: [PATCH] compress .gnu.debuglto_.debug_* sections if requested Message-ID: References: <7e8f08f2-6c4f-0bfb-8cd0-bec1bf6fe5c2@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7e8f08f2-6c4f-0bfb-8cd0-bec1bf6fe5c2@suse.cz> X-Spam-Status: No, score=-3028.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Sep 29, 2022 at 03:35:15PM +0200, Martin Liška wrote: > + /* Compress/decompress DWARF debug sections with names: .debug_*, > + .zdebug_*, .gnu.debuglto_.debug_, after the section flags is set. */ > if ((newsect->flags & SEC_DEBUGGING) != 0 > && (newsect->flags & SEC_HAS_CONTENTS) != 0 > - && ((name[1] == 'd' && name[6] == '_') > - || (name[1] == 'z' && name[7] == '_'))) > + && (startswith (name, ".debug_") > + || startswith (name, ".zdebug_") > + || startswith (name, ".gnu.debuglto_.debug_"))) If you test "(newsect->flags & SEC_ELF_OCTETS) != 0" as well, I think you could omit any name tests here. This would also compress .gnu.linkonce.wi.* sections. (Not that they matter very much, I'm just pointing out a code simplification.) > --- a/gas/write.c > +++ b/gas/write.c > @@ -1481,7 +1481,8 @@ compress_debug (bfd *abfd, asection *sec, void *xxx ATTRIBUTE_UNUSED) > return; > > section_name = bfd_section_name (sec); > - if (!startswith (section_name, ".debug_")) > + if (!startswith (section_name, ".debug_") > + && !startswith (section_name, ".gnu.debuglto_.debug_")) > return; > > bool use_zstd = abfd->flags & BFD_COMPRESS_ZSTD; Hmm, it looks to me like this function will transform ".gnu.debuglto_.debug_*" to ".zgnu.debuglto_.debug_*" if --compress-debug-sections=zlib-gnu is used, which will break your elf.c change. Please check --compress-debug-sections=zlib-gnu. -- Alan Modra Australia Development Lab, IBM