-
Notifications
You must be signed in to change notification settings - Fork 153
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: fix data for segments in dyld caches #673
Conversation
@mstange Can you review this, and do you know if the following code needs fixing too? Edit: I've fixed this too now. object/src/read/macho/section.rs Line 196 in 9650d64
|
e921126
to
0feeab8
Compare
I'll take a look. I'm a bit surprised because I thought I was using segment data for the assembly view, here: https://github.com/mstange/samply/blob/6ec2c01f8e4f30c570321b8516fba975e62ab135/samply-symbols/src/binary_image.rs#L279-L280 |
The code looks wrong to me, but I haven't tested it. I'll see if I can put together a test. |
I obtained a login to a macOS 13.6.6 system. I changed |
I see the same on macOS 14.4.1. So maybe what I observed in the original commit on macOS 12.0.1 no longer happens:
I've sent you an email with the macOS 12.0.1 arm64e dyld shared cache. |
Ok, so I think the one case where the segment data would have been wrong is if you had asked for the data of the Anyway, I think your fix makes sense. |
0feeab8
to
f59315a
Compare
Use the correct subcache for operations on the segment itself. Individual section data was already using the correct subcache. This also does the change for section relocations, but they shouldn't be present in the dyld cache.
f59315a
to
84b5220
Compare
Thanks for looking into this, and for the email. I did some manual testing to check that this had an effect. |
Use the correct subcache for operations on the segment itself. Individual section data was already using the correct subcache. This also does the change for section relocations, but they shouldn't be present in the dyld cache.
Note that this is only for operations on the segment itself. Sections within the segment were already using the correct data.