Load dyld manually with 'main bin spec' userland corefiles
In ProcessMachCore::DoLoadCore when we have a standalone binary and a 'main bin spec' LC_NOTE detailing the UUID and load address, ProcessMachCore will do a (potentially slow) lookup to try to find the binary and/or dSYM. For kernel and userland corefile using 'main bin spec', we would follow the normal schemes of locating them. DynamicLoaderDarwinKernel would use the same (possibly expensive) calls to find the correct binary. dyld by default would use the in-core-file binary image, and so if the corefile didn't include the entire address space, the LINKEDIT for dyld could be missing. This means we can't find the dyld4::dyld_all_image_infos struct, which tells us where the other binaries are loaded in memory. Treat userland 'bin main spec' like we do standalone firmewares; try the expensive checks to find the best dyld we can, before falling back to using a memory module out of the corefile. Also add a little TODO for myself in this load_standalone_binary function that we should handle the case of a binary in the shared cache correctly, creating a memory module in the corefile and using the segment load addresses from that to set our segment load addresses for the final binary. rdar://89717101
Loading
Please sign in to comment