Lookup a symbol in an ELF binary.
Defined in <mojoelf.h>
void * MOJOELF_dlsym(void *lib, const char *sym);| void * | lib | a handle from a MojoELF-opened ELF binary. |
| const char * | sym | the symbol to look up. |
(void *) Returns non-NULL address of the symbol if found, NULL if not found. On failure, a human-readable error message may be obtained by calling MOJOELF_dlerror().
The lib param must be a pointer returned from MOJOELF_dlopen_mem() or MOJOELF_dlopen_file(). You can not use a
handle returned from the C runtime's dlopen() function here!
A NULL return value means the symbol was not found. Strictly speaking, though, a symbol could have a valid address of NULL--zero--but this is not allowed in MojoELF, and would be extremely foolish anyhow.
this function is not thread-safe.
This function is available since MojoELF 1.0.0.