From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 6F041385828D for ; Thu, 23 Feb 2023 13:27:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6F041385828D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id A0C7320B1C; Thu, 23 Feb 2023 13:27:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1677158850; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GlE3OqYOoHKiguQHMgrD+yskwhHNstjUgePbGw9yJGk=; b=mo03Zvm4M6s2FK9QRbFLqSiojqSdaweQO6Q2rJa/G7DnWTxwy80AxAukACcGQI++kt8Zv9 OGyulC9uCryAWOUT9YKre2XSGtxVbhByxUkLtP7vKOeMSFHpQcgFn6p3Zk2o22/UEwCLK0 x2jG8/+RMs9OOfNQ7FC8DOOT3GOgGis= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1677158850; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GlE3OqYOoHKiguQHMgrD+yskwhHNstjUgePbGw9yJGk=; b=qN5rR2nns/+MbapJMDIqKKlUS/fWi8d9DveeguFt1hTdTe+Xjf6rSrrmIn0xZaF9mQyNWT EU2N/wCEqapuP7Cg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 87B20139B5; Thu, 23 Feb 2023 13:27:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id qQ+WH8Jp92OkdAAAMHmgww (envelope-from ); Thu, 23 Feb 2023 13:27:30 +0000 Message-ID: <7dcb7bfb-f65d-aed8-78d4-944211ef5127@suse.de> Date: Thu, 23 Feb 2023 14:27:48 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH] gas: Add --force-compress-debug-sections To: Jan Beulich Cc: binutils@sourceware.org References: <20230223124519.4228-1-tdevries@suse.de> Content-Language: en-US From: Tom de Vries In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 2/23/23 14:08, Jan Beulich wrote: > On 23.02.2023 13:45, Tom de Vries via Binutils wrote: >> Gas has an option --compress-debug-sections that allows it to generate >> compressed debug sections. >> >> That does not guarantee that the debug sections are in fact compressed: >> ... >> $ gcc ~/hello.c -Wa,-gdwarf-5 -c -Wa,--compress-debug-sections=zstd >> $ readelf -S -W hello.o | grep " .debug" >> [ 9] .debug_line PROGBITS 0000a8 000053 00 0 0 1 >> [11] .debug_line_str PROGBITS 0000fb 000025 01 MS 0 0 1 >> [12] .debug_info PROGBITS 000120 000039 00 0 0 1 >> [14] .debug_abbrev PROGBITS 000159 000028 00 0 0 1 >> [15] .debug_aranges PROGBITS 000190 000030 00 0 0 16 >> [17] .debug_str PROGBITS 0001c0 000039 01 MS 0 0 1 >> ... >> >> Sensibly so, they're only compressed if that provides a size benefit. >> >> However, for the purposes of testing components consuming dwarf >> we may want the sections to be compressed regardless. >> >> Add a new option --force-compress-debug-sections that ignores the size >> heuristic, such that we have instead: >> ... >> $ gcc ~/hello.c -Wa,-gdwarf-5 -c -Wa,--compress-debug-sections=zstd \ >> -Wa,--force-compress-debug-sections >> $ readelf -S -W hello.o | grep " .debug" >> [ 9] .debug_line PROGBITS 0000a8 000064 00 C 0 0 8 >> [11] .debug_line_str PROGBITS 000110 000046 01 MSC 0 0 8 >> [12] .debug_info PROGBITS 000158 000046 00 C 0 0 8 >> [14] .debug_abbrev PROGBITS 0001a0 000049 00 C 0 0 8 >> [15] .debug_aranges PROGBITS 0001f0 000034 00 C 0 0 8 >> [17] .debug_str PROGBITS 000228 00005a 01 MSC 0 0 8 >> ... >> >> Advertised as: >> ... >> $ as --help 2>&1 | grep compress >> --compress-debug-sections[={none|zlib|zlib-gnu|zlib-gabi|zstd}] >> compress DWARF debug sections >> --nocompress-debug-sections >> don't compress DWARF debug sections >> --force-compress-debug-sections >> force compression of DWARF debug sections > > No objection in principle, but have you considered making this a new > sub-option to --compress-debug-sections, i.e. compress-debug-sections=force? I did consider adding a "force-" prefix variant for all the non-none sub-options, but decided to go with the simplest solution first. Your suggestion, --compress-debug-sections=force is more orthogonal, though it breaks the pattern that all the sub-options are mutually exclusive. We could have it be standalone, so you'd do: --compress-debug-sections=zstd --compress-debug-sections=force. Or instead combined: --compress-debug-sections=force,zstd. Harder to parse though, I suppose. I guess this last one would be my preference, because it makes it clear force is in a different category than zlib/zstd. Thanks, - Tom > (I've actually been puzzled by --nocompress-debug-sections, which looks to > be no different than --compress-debug-sections=none.)