On May 4, 2005, at 11:58 PM, Timothy J. Wood wrote:
On May 3, 2005, at 5:59 PM, Greg Parker wrote:
Tiger has a rewritten dyld that provides better image notification
hooks for the Objective-C runtime. objc4-266 uses these hooks
instead of the old dyld_register_func mechanism, but Tiger's dyld
doesn't send the unload notification yet.
Can we depend on this ourselves -- is there public API/docs for
this new section?
// Special section containing a function pointer that dyld will
call
// when it loads new images.
LAZY_PIC_FUNCTION_STUB(__objc_notify_images)
.data
.section __DATA,__image_notify
.long L__objc_notify_images$stub
It looks like this code won't build, though (at least not on
Tiger, maybe on Darwin) since objc-runtime.m has:
#include <mach-o/dyld_gdb.h>
and there is no such header on my machine. Hopefully this is an
oversight and this file was supposed to be included to replace the
stuff in dyld_debug.h that got deprecated.
The file is available from opensource.apple.com in the dyld project.
The part you need for objc4 is:
struct dyld_image_info {
const struct mach_header* imageLoadAddress; /* base
address image is mapped into */
const char* imageFilePath; /* path dyld
used to load the image */
uintptr_t imageFileModDate; /* time_t of
image file */
/* if stat().st_mtime of imageFilePath does not match
imageFileModDate, */
/* then file has been modified since dyld loaded it */
};
I wouldn't use this mechanism on any code that needs to run on 10.5.
Right now, it's only intended for gdb and objc4.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden