Skip to content

Conversation

bdash
Copy link
Contributor

@bdash bdash commented Oct 21, 2025

The parsing of fix-up chains is moved out of MachoView and into its own class. It deals purely in terms of offsets into the Mach-O slice. MachoView translates those offsets to mapped addresses when needed.

This is primarily aimed at fixing incorrect handling of pointer formats that use offsets where in some cases the relocations would be applied at incorrect addresses due to confusion between file offsets, Mach-O slice offsets, and VM offsets.

It incidentally fixes addends from bind operations not being respected. These show up most frequently in C++ RTTI information.

The chained fix-up parser contains a #define to enable it to produce debug output in the same format as dyld_info -fixup_chain_details to make it easy to cross-check parsing against Apple's implementation.

Fixes #7421.

The parsing of fix-up chains is moved out of `MachoView` and into its
own class. It deals purely in terms of offsets into the Mach-O slice.
`MachoView` translates those offsets to mapped addresses when needed.

This is primarily aimed at fixing incorrect handling of pointer formats
that use offsets where in some cases the relocations would be applied at
incorrect addresses due to confusion between file offsets, Mach-O slice
offsets, and VM offsets.

Additionally, it fixes addends from bind operations not being respected.
These show up most frequently in C++ RTTI information.
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

Successfully merging this pull request may close these issues.

[MachO] Obj-C metadata errors due to incorrect handling of some chained fixups

1 participant