Hide and go seek.
Hide and go seek.
- Subject: Hide and go seek.
- From: James Quick <email@hidden>
- Date: Mon, 14 Jul 2003 18:30:58 -0400
I am sick of playing this game....
The dyld man page states that the function:
enum bool _dyld_get_image_header_containing_address(unsigned long
address);
does this:
_dyld_get_image_header_containing_address It returns a
pointer to the mach header of the image if the address is
contained in an image dyld loaded and NULL otherwise.
Not only is the function undefined, the man page must be incorrect
because enum bool
is hardly the signature of a function that returns a (mach_header *).
Since the documentation was obviously broken I turned to the Force
(look at source Luke).
This was no more enlightening. The closest I could come was the source
code in cctools/libdylib.
This confused the hell out of me. It contained function after function
which was simply
a loosely bound call to some other function. Of course these functions
must both defined
elsewhere, but the code does not give any clues as to where else to
look.
For instance:
unsigned long
_dyld_image_count(void)
{
static unsigned long (*p)(void) = NULL;
if(_dyld_present() == 0)
return(0);
if(p == NULL)
_dyld_func_lookup("__dyld_image_count", (unsigned long
*)&p);
return(p());
}
So I have two questions.
1. Where are the dyld functions actually implemented.
2. What support does the dylib subsystem have for finding out where
something
was loaded from? For instance I need to find out what segment/section
contains the text of a function or method at runtime.
Do I have to do all this by hand, or was Apple just playing a practical
joke by
including a reference to _dyld_get_image_header_containing_address.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.