[PATCH] gas: Add --force-compress-debug-sections

Tom de Vries tdevries@suse.de
Thu Feb 23 15:28:47 GMT 2023


On 2/23/23 16:23, Michael Matz wrote:
> Hello,
> 
> On Thu, 23 Feb 2023, Tom de Vries via Binutils wrote:
> 
>> 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.
> 
> Regardless of the outcome how to spell this on the cmdline, can the
> force-mode please be explicitely documented as doing stuff "even if it
> increases section size", at least in the .info docu (not necessarily in
> --help output).  Because, knowing users trying random options, they might
> be tempted to use the force-mode, because "it surely will be better" and
> the remark would hopefully deflect this.
> 

The submitted version ( 
https://sourceware.org/pipermail/binutils/2023-February/126284.html ) 
contains:
...
@@ -718,7 +719,8 @@ Begin in alternate macro mode.
  Compress DWARF debug sections using zlib with SHF_COMPRESSED from the
  ELF ABI.  The resulting object file may not be compatible with older
  linkers and object file utilities.  Note if compression would make a
-given section @emph{larger} then it is not compressed.
+given section @emph{larger} then it is not compressed, unless
+@option{--force-compress-debug-section} is used.

  @ifset ELF
  @cindex @samp{--compress-debug-sections=} option
@@ -738,7 +740,11 @@ using the obsoleted zlib-gnu format.  The debug 
sections are renamed to begin
  with @samp{.zdebug}.
  @option{--compress-debug-sections=zstd} compresses DWARF debug
  sections using zstd.  Note - if compression would actually make a section
-@emph{larger}, then it is not compressed nor renamed.
+@emph{larger}, then it is not compressed nor renamed, unless
+@option{--force-compress-debug-section} is used.
+
+@item --force-compress-debug-sections
+Compress DWARF debug sections, even if this does not reduce size.

  @end ifset
...

So, do you consider this insufficient?

Thanks,
- Tom



More information about the Binutils mailing list