ADC Home > Reference Library > Reference > Mac OS X > Mac OS X Man Pages

 

This document is a Mac OS X manual page. Manual pages are a command-line technology for providing documentation. You can view these manual pages locally using the man(1) command. These manual pages come from many different sources, and thus, have a variety of writing styles.

For more information about the manual page format, see the manual page for manpages(5).



DLSYM(3)                 BSD Library Functions Manual                 DLSYM(3)

NAME
     dlsym -- get address of a symbol

SYNOPSIS
     #include <dlfcn.h>

     void*
     dlsym(void* handle, const char* symbol);

DESCRIPTION
     dlsym() returns the address of the code or data location specified by the null-terminated character
     string symbol.  Which libraries and bundles are searched depends on the handle parameter.

     If dlsym() is called with a handle, returned by dlopen() then only that image and any libraries it
     depends on are searched for symbol.

     If dlsym() is called with the special handle RTLD_DEFAULT, then all mach-o images in the process
     (except those loaded with dlopen(xxx, RTLD_LOCAL)) are searched in the order they were loaded.  This
     can be a costly search and should be avoided.

     If dlsym() is called with the special handle RTLD_NEXT, then the search for the symbol is limited to
     the images which were loaded after the one issuing the call to dlsym().

RETURN VALUES
     The dlsym() function returns a null pointer if the symbol cannot be found, and sets an error condition
     which may be queried with dlerror().

NOTES
     Unlike other dyld API's, the symbol name passed to dlsym() must NOT be prepended with an underscore.

SEE ALSO
     dlopen(3) dlsym(3) dlerror(3) dyld(3) NSModule(3) NSObjectFileImage(3) ld(1) cc(1)

                                 Sept 25, 2004

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.