public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
From: "i at maskray dot me" <sourceware-bugzilla@sourceware.org>
To: gdb-prs@sourceware.org
Subject: [Bug gdb/29584] gdb: support zstd compressed .gnu_debugdata
Date: Sun, 19 Feb 2023 19:24:27 +0000	[thread overview]
Message-ID: <bug-29584-4717-z4ibuO8lHO@http.sourceware.org/bugzilla/> (raw)
In-Reply-To: <bug-29584-4717@http.sourceware.org/bugzilla/>

https://sourceware.org/bugzilla/show_bug.cgi?id=29584

--- Comment #8 from Fangrui Song <i at maskray dot me> ---
(In reply to Mark Wielaard from comment #7)
> > To embed an ELF file (with .symtab, .strtab, and optionally .debug_*), we
> > need
> > one `objcopy --add-section` command, then one `eu-elfcompress -n` command
> > (with
> > no binutils equivalent
> > https://sourceware.org/bugzilla/show_bug.cgi?id=27452).
> > Even eu-elfcompress -n doesn't provide the various zstd options that a
> > distribution may toggle.
> 
> There is already support in eu-elfcompress, it will show up in the next
> release (0.189, hopefully later this month):
> 
>   -n, --name=SECTION         SECTION name to (de)compress, SECTION is an
>                              extended wildcard pattern (defaults to
>                              '.?(z)debug*')
> [...]
>   -t, --type=TYPE            What type of compression to apply. TYPE can be
>                              'none' (decompress), 'zlib' (ELF ZLIB
> compression,
>                              the default, 'zlib-gabi' is an alias),
> 'zlib-gnu'
>                              (.zdebug GNU style compression, 'gnu' is an
> alias)
>                              or 'zstd' (ELF ZSTD compression)

I have seen
https://sourceware.org/git/?p=elfutils.git;a=commit;h=a5b07cdf9c491fb7a4a16598c482c68b718f59b9
(support ZSTD compression algorithm). I am thinking about Operation modifiers
like the compression level, window size, dictionary, etc. A Linux distribution
may have many packages which are not used for debugging, spending additional
time on the producer side is probably a win. Some use cases may prefer a fast
producer.

> > Also, this process involves two binary manipulation commands on
> > the ELF file.
> > 
> > If we use `zstd a.debug; objcopy -S
> > --add-section=.gnu_debugdata=a.debug.zstd a a.stripped`,
> > there is just one binary manipulation command, and we can toggle zstd
> > options easily.
> 
> It is slightly more that that. See debugedit find-debuginfo add_mini how the
> section is created:
> https://sourceware.org/git/?p=debugedit.git;a=blob;f=scripts/find-debuginfo.
> in;hb=HEAD#l332

Notes. You are right:) I noticed this when writing
https://maskray.me/blog/2022-10-30-distribution-of-debug-information#minidebuginfo
but I don't have experience with the package, so did not recall it off the top
my head...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

  parent reply	other threads:[~2023-02-19 19:24 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-19  4:24 [Bug gdb/29584] New: " i at maskray dot me
2022-09-19  4:24 ` [Bug gdb/29584] " i at maskray dot me
2022-09-27  2:54 ` i at maskray dot me
2023-02-16  2:55 ` i at maskray dot me
2023-02-16  6:15 ` tromey at sourceware dot org
2023-02-16  6:25 ` i at maskray dot me
2023-02-16  9:08 ` mark at klomp dot org
2023-02-16 17:42 ` i at maskray dot me
2023-02-16 21:46 ` tromey at sourceware dot org
2023-02-19 13:23 ` mark at klomp dot org
2023-02-19 19:24 ` i at maskray dot me [this message]
2024-03-15  9:16 ` sam at gentoo dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-29584-4717-z4ibuO8lHO@http.sourceware.org/bugzilla/ \
    --to=sourceware-bugzilla@sourceware.org \
    --cc=gdb-prs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).