From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by sourceware.org (Postfix) with ESMTPS id A1649382B3FD for ; Wed, 7 Dec 2022 03:58:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A1649382B3FD 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-pl1-x62d.google.com with SMTP id jn7so15895351plb.13 for ; Tue, 06 Dec 2022 19:58:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=H/EWk3U7fo5k+KCjKEGQD7hQyBlrNDplZxH3ocTGEas=; b=DjVL2mRygDlHBBpfVBgzZMSFPdC2UJx1dAXJmR5SOP7ykcv1EPPnVp2lxqHzywn/Os qynrlM6IwgpPZm9QlgGVB8krCayoRDFbx5LTR08YLCugoseHR0iNxsJ13t52PmAZiRaF xJQQ9XjR070jYSPirHo2xqK9Fva4XHDcLssa4fdQIhOpTbNQ/j2ibXU8vYSf/CRL+WUA odiSAdBGFbQbDfZ+hScBL7m8kz5Ri7FhWZBdZuQ9w10OsNfKkm+Gn+9e44hBXcS899Mr q19cWqMGls272v8XVCsAD6Or+SsByHBkifM6RMAxH4KrZxPC3JZhB3bBxsGiUr6ZzNNc ZwSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=H/EWk3U7fo5k+KCjKEGQD7hQyBlrNDplZxH3ocTGEas=; b=upJiKJgBIvwXDlJrQVAbxjCPdXdAYQsJ2aeBxjwA2pWjVh4b2EHtkjm7VnTH3ckTWG 4PRRWy5Qy+QerKb5HpgdKkBhvZKho4Vrr2Y4eZyGjb3DVzj+/9Z1Vb1s7Kr7yDy9CoSd ZAcyBLZA6+PuZhxHlwcdvdIdcvMqmQ5czzTn3N/NMS3xLOFgsfXqa2UX9oE1Ii3Xlxye xH8B7HCWBjUet86dA3/4DVlzAeuW9DEU5UXropqt5DqCaYbTZecoUZpCAhjt1cDAPTdm TyG2jA3cm9G28BJnC6Yg5Ssk5TzQfD9ceWeM2/U3DqdUNNKwDrzpo+fAIH5NuWET8fpt EpjQ== X-Gm-Message-State: ANoB5pmxNNEM1DubR1ygk6vtPVLM4OaBIAj2DLuGmigTgmLMuwwm97Uv LyqCGqkRM+o+g9XggveeeK+Luy2SqGI= X-Google-Smtp-Source: AA0mqf7H9cak91+04K8rUiyyLOsAnb5HP7dQLI9v6YsyYENa6fniiJuigpwap+PsSTM4NovUjTxYTQ== X-Received: by 2002:a17:90a:ebd1:b0:21a:962:159 with SMTP id cf17-20020a17090aebd100b0021a09620159mr3860482pjb.216.1670385511688; Tue, 06 Dec 2022 19:58:31 -0800 (PST) Received: from squeak.grove.modra.org (158.106.96.58.static.exetel.com.au. [58.96.106.158]) by smtp.gmail.com with ESMTPSA id k26-20020aa79d1a000000b00575fbe1cf2esm11563054pfp.109.2022.12.06.19.58.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Dec 2022 19:58:31 -0800 (PST) Received: by squeak.grove.modra.org (Postfix, from userid 1000) id B05711140592; Wed, 7 Dec 2022 14:28:28 +1030 (ACDT) Date: Wed, 7 Dec 2022 14:28:28 +1030 From: Alan Modra To: Fangrui Song Cc: binutils@sourceware.org Subject: Re: Compression tidy and fixes Message-ID: References: <20221207032825.ooufkrniqye3uegq@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221207032825.ooufkrniqye3uegq@gmail.com> X-Spam-Status: No, score=-3030.0 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 Tue, Dec 06, 2022 at 07:28:25PM -0800, Fangrui Song wrote: > On 2022-12-07, Alan Modra via Binutils wrote: > > Tidies: > > - Move stuff from bfd-in.h and libbfd.c to compress.c > > libbfd.[ch] is really supposed to be for BFD internal use only. > > - Delete COMPRESS_DEBUG from enum compressed_debug_section_type > > - Move compress_debug field out of link_info to ld_config. > > The idea here is to ignore what the user requested after translating > > to bfd flags, so there is just one place where the user request gets > > translated to what is supported. Similarly for gas and objcopy. > > Fixes: > > - Correct test in bfd_convert_section_setup to use obfd flags, > > not ibfd. > > - Apply bfd_applicable_file_flags to compression bfd flags added > > by gas and ld to the output bfd. > > > > If .zdebug renaming turns out to be tricky, consider making > zlib-gnu output no-op. zlib-gnu is pretty obsoleted now and in the latest > GCC, -gz=zlib-gnu is a no-op. (iirc) gas > --compress-debug-sections=zlib-gnu doesn't compress a .debug_* if the > compressed output would be larger than the uncompressed one. What got me into looking at the compression support in BFD was discovering I'd broken the COFF/PE compressed debug support. There we only support zlib-gnu. -- Alan Modra Australia Development Lab, IBM