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

Symbols missing for some macOS 12 system libraries on arm64 #22

Closed
mstange opened this issue Nov 6, 2021 · 5 comments
Closed

Symbols missing for some macOS 12 system libraries on arm64 #22

mstange opened this issue Nov 6, 2021 · 5 comments

Comments

@mstange
Copy link
Owner

mstange commented Nov 6, 2021

For example there are no symbols for /usr/lib/system/libsystem_malloc.dylib.

@mstange
Copy link
Owner Author

mstange commented Nov 6, 2021

Looking into this more, I can observe the following:

  • I can successfully get symbols for the .1 chunk, e.g. /System/Library/dyld/dyld_shared_cache_arm64e.1 /System/Library/PrivateFrameworks/GameCenterUI.framework/Versions/A/GameCenterUI
  • I can successfully get symbols for the zero chunk (the one without extension) for x86_64 but not for arm64e.
  • For libraries in /System/Library/dyld/dyld_shared_cache_arm64e, i.e. the arm64e zero chunk, I get the correct list of symbols but the symbol name strings are all invalid.

So maybe there's a string table offset for the zero chunk that I need to respect.

@mstange
Copy link
Owner Author

mstange commented Nov 6, 2021

It looks like the string table for libraries in the arm64e chunk is actually in the arm64e.1 chunk.

@mstange
Copy link
Owner Author

mstange commented Nov 8, 2021

... because that's where the __LINKEDIT section was placed. So the MachOFile needs to read from two different input data streams. There's currently no API for that in the object crate.

@mstange
Copy link
Owner Author

mstange commented Dec 1, 2021

Support for this format has now landed in gimli-rs/object#398. Once a new object release is available, we just need to update to it and this should work.

@mstange
Copy link
Owner Author

mstange commented Jan 3, 2022

This was fixed in d1c8fd6.

@mstange mstange closed this as completed Jan 3, 2022
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

1 participant