Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use object's support for zstd compressed DWARF #468

Merged
merged 2 commits into from
Jan 19, 2025

Conversation

hanna-kruppe
Copy link
Contributor

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's addr2line (binutils 2.42) can give file paths and line numbers while wholesym-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.

@mstange
Copy link
Owner

mstange commented Jan 19, 2025

Thank you, looks good! Not sure why I didn't do it that way to begin with. I'll make a PR to fix clippy and then rebase this on top of it.

@mstange mstange enabled auto-merge January 19, 2025 16:58
@mstange mstange merged commit 03ed258 into mstange:main Jan 19, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants