-
Notifications
You must be signed in to change notification settings - Fork 150
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
Support go's Mach-O dwarf compression #696
Comments
Does that mean none of the standard Mach-O system tools are able to parse these DWARF sections, only the go tools? e.g. does llvm support this at all? I know little about go. Is it possible for me to create a Mach-O file containing these sections using a linux system? |
The llvm tools do not seem to work, no. Just the go tools seem to work.
Yes, you can. Go can natively cross compile. Consider:
GOOS=darwin go build -o main ./main.go This will build a Mach-O file that can run on a mac from a linux machine. There's actually two annoying things you'll notice about these binaries, and it's not the one I mention here that you'll likely hit first:
I have code to deal with both, and the code described in this issue is really the more straightforward one. The first one applies more to the If you'd talk me through the testing you'd like to see, I'd be happy to send a patch for this. |
We do already handle the '__'prefix. And we already handle a For testing, ELF currently tests this by generating its own files. However, a better test is probably to add a file to https://github.com/gimli-rs/object-testfiles/tree/master/macho and then add something in |
Go writes its dwarf sections with a somewhat bespoke format inspired by the GNU format with the
ZLIB
header. See: https://github.com/golang/go/blob/45446c867a3ffdf893bdfd1e1ef9e30166eaa157/src/debug/macho/file.go#L623-L645One can manually work around this, but it'd be convenient for the implementation of
ObjectSection
forMachOSection
to do it for users here:object/src/read/macho/section.rs
Lines 165 to 173 in 7b58f78
The text was updated successfully, but these errors were encountered: