iOS15 introduces fixup chain to speeds up the dynamic linking process; when building application targeting OS higher than iOS15 / macOS12, Mach-O uses fixup chain in replacement of rebase / binding information, to instruct dyld how to link dynamic libraries. This option aims to behave like the -chained_fixups option of MacOS's otool-classic, which dumps structs related to fixup chain in Mach-O object files, including dyld_chained_fixups_header, dyld_chained_starts_in_image, dyld_chained_starts_in_segment and dyld_chained_import[_addend][64].
Diff Detail
Event Timeline
llvm/include/llvm/BinaryFormat/MachO.h | ||
---|---|---|
298 | Comments should use full English grammar, including leading capital letter and trailing period. Applies throughout. | |
llvm/test/tools/llvm-objdump/MachO/chained_fixups_dump.test | ||
1 | If possible, it would be preferable to have yaml2obj generate this input (or generate it from IR/assembly), so that the test doesn't rely on an opaque binary. | |
51 | Nit: add new line at EOF. | |
llvm/tools/llvm-objdump/MachODump.cpp | ||
10774–10775 | Please refer to the LLVM coding standards for error and warning messages. Is there a generic llvm-objdump error function you could use instead? | |
llvm/tools/llvm-objdump/ObjdumpOpts.td | ||
248–250 | Please make sure new options are in the llvlm-objdump CommandGuide located in llvm/docs. |
This is great, but I recently started a patch series to upstream Apple's internal implementation. Maybe we can work together to land this feature?
See https://reviews.llvm.org/D113630 and dependencies. (There are more patches waiting in the pipeline).
Great! I'm new to llvm and I didn't know that there are already patches supporting this feature, so maybe it's better to stick with your implementation. I will be glad to work together to land this feature if there is anything I can help. :)
FWIW I started working on yaml2obj support for chained fixups, I have it working where the chained fixups are just bytes and not a structured representation, but it would help avoid checking in more binaries for test fixtures.
I'm really excited about all this interest in chained fixups. I won't be able to make any progress on this throughout the next week, but I promise I'll get back to pushing out more patches right after. In the meantime it would be great if you could take a look at my existing patch stack (which just lays down the very first steps) and add your review comments. Thanks for your patience!
I submitted https://reviews.llvm.org/D119671 which if accepted would aid with the tests here
Comments should use full English grammar, including leading capital letter and trailing period. Applies throughout.