6 .Nd find the image containing a given address
10 .Fn dladdr "const void* addr" "Dl_info* info"
15 queries dyld (the dynamic linker) for information about the image
16 containing the address
18 The information is returned in the structure specified by
20 The structure contains at least the following members:
21 .Bl -tag -width "XXXconst char *dli_fname"
22 .It Li "const char* dli_fname"
23 The pathname of the shared object containing the address.
24 .It Li "void* dli_fbase"
25 The base address (mach_header) at which the image is mapped into the
26 address space of the calling process.
27 .It Li "const char* dli_sname"
28 The name of the nearest run-time symbol with a value less than or
31 .It Li "void* dli_saddr"
32 The value of the symbol returned in
39 is available only in dynamically linked programs.
41 If an image containing
46 On success, a non-zero value is returned.
48 If the image containing
50 is found, but no nearest symbol was found,
51 the dli_sname and dli_saddr fields are set to NULL.
58 function first appeared in the Solaris operating system.
60 Mac OS X 10.3 incorporated the dlcompat package written by Jorge Acereda <jacereda@users.sourceforge.net>
61 and Peter O'Gorman <ogorman@users.sourceforge.net>.
63 In Mac OS X 10.4, dlopen was rewritten to be a native part of dyld.
65 This man page was borrowed from FreeBSD and modified.
67 This implementation is almost bug-compatible with the Solaris
68 implementation. The following bugs are present:
71 Returning 0 as an indication of failure goes against long-standing