read/macho: dyld cache slide information improvements#775
Merged
philipc merged 12 commits intogimli-rs:masterfrom Jun 2, 2025
Merged
read/macho: dyld cache slide information improvements#775philipc merged 12 commits intogimli-rs:masterfrom
philipc merged 12 commits intogimli-rs:masterfrom
Conversation
Note: I think this slide info is present since macOS 11. I have tested on a dyld cache from macOS 11, but I don't have an older dyld cache to test on.
The symbol table data is stored in the linkedit segment, but that segment may be in a different subcache from the one containing the image headers. This occurs for the arm dyld cache in macOS 13. MachOFile::parse_dyld_cache_image already handled this correctly, but readobj doesn't use that.
This is leftover from before subcaches were supported.
Delete fields that are duplicates of information in DyldCache and DyldFile. This makes the enum similar to DyldSubCacheSlice.
Also extract common fields of the mapping enum.
Print the cache header and mappings for every subcache, instead of only the primary cache file. Also print the mapping slide information headers.
I think the offset can be useful in itself, and the address and file offset are easily derived from it.
Change the methods on DyldCacheSlidePointer5 to simply extract the bitfields, and leave other interpretation to the parser. Also move PtrauthKey to DyldRelocationAuth, since it is not an externally defined format.
This will be useful when supporting more slide versions. Also shorten its name.
This takes the place of wrapping it in Option. Also shorten its name.
Having a separate versioned DyldCacheRelocationPageIterator is a flexibility that is not required, and combining them is simpler.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See individual commits. Includes some fixes, API changes, and slide version 2 and 3 support.