#include <mach-o/dyld_images.h>

mach-o/dyld_images.h

includes: stdbool.h, uuid/uuid.h, TargetConditionals.h, unistd.h, mach/mach.h
6 structs · 3 macros · 2 enums · 1 typedef · 1 variable

macro_DYLD_IMAGES_

#define _DYLD_IMAGES_ 

enumdyld_image_mode

underlying type unsigned int
dyld_image_adding0
dyld_image_removing1
dyld_image_info_change2
dyld_image_dyld_moved3

structdyld_image_info

size 24, align 8
const struct mach_header *imageLoadAddressbase address image is mapped into
const char *imageFilePathpath dyld used to load the image
uintptr_timageFileModDatetime_t of image file

structdyld_uuid_info

size 24, align 8
const struct mach_header *imageLoadAddressbase address image is mapped into
uuid_timageUUIDUUID of image

macroDYLD_AOT_IMAGE_KEY_SIZE

#define DYLD_AOT_IMAGE_KEY_SIZE 32

structdyld_aot_image_info

size 56, align 8
const struct mach_header *x86LoadAddress
const struct mach_header *aotLoadAddress
uint64_taotImageSize
uint8_t[32]aotImageKeyuniquely identifying SHA-256 key for this aot

structdyld_aot_shared_cache_info

size 24, align 8
const uintptr_tcacheBaseAddress
uuid_tcacheUUID

typedefdyld_image_notifier

typedef void (*dyld_image_notifier)(enum dyld_image_mode mode, uint32_t infoCount, const struct dyld_image_info info[])

enum(anonymous)

for use in dyld_all_image_infos.errorKind field
underlying type unsigned int
dyld_error_kind_none0
dyld_error_kind_dylib_missing1
dyld_error_kind_dylib_wrong_arch2
dyld_error_kind_dylib_version3
dyld_error_kind_symbol_missing4

macroDYLD_MAX_PROCESS_INFO_NOTIFY_COUNT

internal limit
#define DYLD_MAX_PROCESS_INFO_NOTIFY_COUNT 8

structdyld_all_image_infos

size 368, align 16
uint32_tversion1 in Mac OS X 10.4 and 10.5
uint32_tinfoArrayCount
const struct dyld_image_info *infoArray
dyld_image_notifiernotification
_BoolprocessDetachedFromSharedRegion
_BoollibSystemInitializedthe following fields are only in version 2 (Mac OS X 10.6, iPhoneOS 2.0) and later
const struct mach_header *dyldImageLoadAddress
void *jitInfothe following field is only in version 3 (Mac OS X 10.6, iPhoneOS 3.0) and later
const char *dyldVersionthe following fields are only in version 5 (Mac OS X 10.6, iPhoneOS 3.0) and later
const char *errorMessage
uintptr_tterminationFlags
void *coreSymbolicationShmPagethe following field is only in version 6 (Mac OS X 10.6, iPhoneOS 3.1) and later
uintptr_tsystemOrderFlagthe following field is only in version 7 (Mac OS X 10.6, iPhoneOS 3.1) and later
uintptr_tuuidArrayCountthe following field is only in version 8 (Mac OS X 10.7, iPhoneOS 3.1) and later
const struct dyld_uuid_info *uuidArrayonly images not in dyld shared cache
struct dyld_all_image_infos *dyldAllImageInfosAddressthe following field is only in version 9 (Mac OS X 10.7, iOS 4.0) and later
uintptr_tinitialImageCountthe following field is only in version 10 (Mac OS X 10.7, iOS 4.2) and later
uintptr_terrorKindthe following field is only in version 11 (Mac OS X 10.7, iOS 4.2) and later
const char *errorClientOfDylibPath
const char *errorTargetDylibPath
const char *errorSymbol
uintptr_tsharedCacheSlidethe following field is only in version 12 (Mac OS X 10.7, iOS 4.3) and later
uint8_t[16]sharedCacheUUIDthe following field is only in version 13 (Mac OS X 10.9, iOS 7.0) and later
uintptr_tsharedCacheBaseAddressthe following field is only in version 15 (macOS 10.12, iOS 10.0) and later
uint64_tinfoArrayChangeTimestamp
const char *dyldPath
mach_port_t[8]notifyPorts
uintptr_t[7]reserved
uint64_tsharedCacheFSIDThe following fields were added in version 18 (previously they were reserved padding fields)
uint64_tsharedCacheFSObjID
uintptr_tcompact_dyld_image_info_addrthe following field is only in version 16 (macOS 10.13, iOS 11.0) and later
size_tcompact_dyld_image_info_size
uint32_tplatformFIXME: really a dyld_platform_t, but those aren't exposed here.
uint32_taotInfoCountthe following field is only in version 17 (macOS 10.16) and later
const struct dyld_aot_image_info *aotInfoArray
uint64_taotInfoArrayChangeTimestamp
uintptr_taotSharedCacheBaseAddress
uint8_t[16]aotSharedCacheUUID

structdyld_shared_cache_ranges

Beginning in Mac OS X 10.5, this is how gdb discovers where the shared cache is in a process. Images that are in the shared cache have their segments rearranged, so when using imageFilePath to load the file from disk, you have to know to adjust addresses based on how their segment was rearranged. gdb looks for the symbol "_dyld_shared_region_ranges" in dyld. It contains information the count of shared regions used by the process. The count is the number of start/length pairs.
size 72, align 8
uintptr_tsharedRegionsCounthow many ranges follow
unnamed struct at mach-o/dyld_images.h:211:2[4]rangesmax regions

variabledyld_shared_cache_ranges

extern struct dyld_shared_cache_ranges dyld_shared_cache_ranges