Added support for dladdr()

dladdr() is a GNU extension function, which allows the caller to retrieve
symbol information for a specified memory address.  It is useful for things
like generating backtrace information at runtime.

Change-Id: I3a1def1a6c9c666d93e1e97b7d260dfa5b9b79a9
This commit is contained in:
Matt Fischer
2009-12-31 12:17:40 -06:00
committed by Garmin Android technology group
parent ede2e75f49
commit e2a8b1fd19
5 changed files with 101 additions and 15 deletions

View File

@@ -32,10 +32,22 @@
__BEGIN_DECLS
typedef struct {
const char *dli_fname; /* Pathname of shared object that
contains address */
void *dli_fbase; /* Address at which shared object
is loaded */
const char *dli_sname; /* Name of nearest symbol with address
lower than addr */
void *dli_saddr; /* Exact address of symbol named
in dli_sname */
} Dl_info;
extern void* dlopen(const char* filename, int flag);
extern int dlclose(void* handle);
extern const char* dlerror(void);
extern void* dlsym(void* handle, const char* symbol);
extern int dladdr(void* addr, Dl_info *info);
enum {
RTLD_NOW = 0,