libnds
|
Helpers to load dynamic libraries. More...
Functions | |
int | dlclose (void *handle) |
Frees all memory used by a dynamic library. | |
char * | dlerror (void) |
Returns a user-readable error string. | |
void * | dlmembase (void *handle) |
Returns a pointer to the base address of the code loaded with the library. | |
void * | dlopen (const char *file, int mode) |
Loads a dynamic library (in DSL format) into RAM. | |
void * | dlsym (void *handle, const char *name) |
Returns a pointer to the requested symbol. | |
Helpers to load dynamic libraries.
The functions in this file allow the user to load DSL (Nintendo DS Loadable) files. They are a simplified version of ELF files created by dsltool
, which is a tool included in BlocksDS.
int dlclose | ( | void * | handle | ) |
char * dlerror | ( | void | ) |
Returns a user-readable error string.
It clears the error string after being called.
void * dlmembase | ( | void * | handle | ) |
Returns a pointer to the base address of the code loaded with the library.
The purpose of this function is to print this address to be used when debugging the code with emulators. You must provide this address when loading the elf file of the library. For example, with the GDB command line:
Note that this is a libnds-specific function.
handle | The handle returned by dlopen(). |
void * dlopen | ( | const char * | file, |
int | mode | ||
) |
Loads a dynamic library (in DSL format) into RAM.
file | Path of the DSL file. |
mode | Mode in which the file will be opened. Currently, the only mode supported is RTLD_NOW | RTLD_LOCAL . Also, RTLD_LOCAL is the default setting, so it isn't required to specify it explicitly. |
void * dlsym | ( | void * | handle, |
const char * | name | ||
) |
Returns a pointer to the requested symbol.
handle | The handle returned by dlopen(). |
name | The name of the requested symbol. |