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

Evalute if it's possibly to dump files directly from macOS dyld shared cache #242

Open
gabrielesvelto opened this issue May 27, 2021 · 1 comment

Comments

@gabrielesvelto
Copy link
Collaborator

I noticed this PR that has been merged in gimli and I wonder if we could use the new functionality to dump macOS system libraries directly out of the dyld shared cache.

@mstange
Copy link
Collaborator

mstange commented Dec 5, 2022

The dyld shared cache parsing code is in the object crate. We are currently using the symbolic-debuginfo crate to get symbols and unwind info from binaries, and that's using goblin and not object. But even if symbolic-debuginfo were using object, it would still need additional APIs to load an image from the shared cache: The shared cache spans multiple files (the root cache + 3-4 "subcaches") and it contains multiple images. So the API would need to be able to load an "archive" from multiple files, and then have a way to specify which "member" of that archive you want to load.

So that would be a bunch of extra work in the symbolic repo. It would also mean that symbolic would ship two binary parsers (goblin and object) unless every existing use of goblin gets migrated; alternatively, there would be a bunch of duplicated code to load symbols and unwind info from object.

Another alternative would be to make dump_syms use object directly, as an second source of symbols. And we'd need a way to get the ASCII CFI from the __unwind_info sections, and that code currently lives in symbolic. I'm not sure how easy the ASCII CFI dumper is to use with section data from object.

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

No branches or pull requests

2 participants