Use object's support for zstd compressed DWARF #468
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This compression method was introduced to ELF in 2022 and toolchain support for it is slowly spreading. For example, Ubuntu 24.04 now has versions of binutils, GCC, and LLVM that can read and write it. I was experimenting with this and (long story short) found out that it breaks symbolication in samply. On a Rust program compiled with
-Clink-arg=-Wl,--compress-debug-sections=zstd
, my system'saddr2line
(binutils 2.42) can give file paths and line numbers whilewholesym-addr2line
fails and reports??:?
.It turns out to be an easy fix because the version + feature flags of
object
used by samply-symbols already has support for reading zstd-compressed sections, it just wasn't used. I decided to use their convenience function for both zstd and zlib formats because it has some additional error checks (defending against incorrect or impossibly large uncompressed size) not present in samply's zlib handling.