-
Notifications
You must be signed in to change notification settings - Fork 159
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
read/macho: support Go's compression format #697
Conversation
TFTR! I also manually tried this out with gimli's Before:
After:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TFTR!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review!
When using compression, sections in Mach-O produced by the go compiler have a __zdebug_ prefix (only the debug sections are compressed).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good to merge after a cargo fmt
.
This commit extracts the GNU-style section compression logic from the read::elf::section to a module underneath read, and then uses it also in read::macho. This is the style of compression created by the go compiler for Mach-O executables.
This commit updates the submodule for the testfiles to include the Mach-O binaries produced by the Go compiler and then exercises the logic in the previous commits. The new testfiles commit is due to gimli-rs/object-testfiles#14.
Sorry for the delay, done. Thank you for the reviews. |
… Go. Object now does this internally, thanks to github.com/gimli-rs/object/pull/697 .
… Go. Object now does this internally, thanks to gimli-rs/object#697 .
This PR adds support in the object crate for Go's format to compress Mach-O debug info sections. It contains two changes:
__
and__z
prefix instead of a.
.__z
prefix and attempts to offer decompression when it detects the section is compressed using the Go compression scheme.A third commit adds testing. This third commit will need to be rebased to update the testfiles commit once gimli-rs/object-testfiles#14 is merged into the upstream.
Fixes #696.