Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fixed substitute not finding dyld symbols correctly on simulator #1

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/darwin/find-syms.c
Original file line number Diff line number Diff line change
Expand Up @@ -384,14 +384,20 @@ ok2: ;
static void inspect_dyld() {
const struct dyld_all_image_infos *aii = dyld_get_all_image_infos();
const void *dyld_hdr = aii->dyldImageLoadAddress;
#if TARGET_OS_SIMULATOR
if (strstr(_dyld_get_image_name(0), "dyld_sim")) {
dyld_hdr = _dyld_get_image_header(0);
}
#endif

const void *libdyld_hdr = NULL;
intptr_t libdyld_slide = 0;
for(uint32_t i = 0; i < _dyld_image_count(); i++) {
const char *im_name = _dyld_get_image_name(i);
if (strcmp(im_name, "/usr/lib/system/libdyld.dylib") == 0){
if (strstr(im_name, "/usr/lib/system/libdyld.dylib")) {
libdyld_hdr = _dyld_get_image_header(i);
libdyld_slide = _dyld_get_image_vmaddr_slide(i);
break;
}
}

Expand Down