enumdyld_image_states { dyld_image_state_mapped =10, // No batch notification for this dyld_image_state_dependents_mapped =20, // Only batch notification for this dyld_image_state_rebased =30, dyld_image_state_bound =40, dyld_image_state_dependents_initialized =45, // Only single notification for this dyld_image_state_initialized =50, dyld_image_state_terminated =60// Only single notification for this };
// // Note: onlyfor use by objc runtime // Register handlers to be calledwhen objc images are mapped, unmapped, and initialized. // Dyld will call back the "mapped" functionwith an arrayof images that contain an objc-image-info section. // Those images that are dylibs will have the ref-counts automatically bumped, so objc will no longer need to // call dlopen() on them to keep them from being unloaded. During the callto _dyld_objc_notify_register(), // dyld will call the "mapped" functionwith already loaded objc images. During any later dlopen() call, // dyld will alsocall the "mapped" function. Dyld will call the "init" functionwhen dyld would be called // initializers in that image. This iswhen objc calls any +load methods in that image. // 通过这个方法可以向dyld注册用于处理镜像完成映射,取消映射和初始化之后的处理方法。 void _dyld_objc_notify_register(_dyld_objc_notify_mapped mapped, _dyld_objc_notify_init init, _dyld_objc_notify_unmapped unmapped);