diff options
author | Matt Fischer <matt.fischer@garmin.com> | 2009-12-31 12:17:40 -0600 |
---|---|---|
committer | Garmin Android technology group <android@garmin.com> | 2010-03-17 16:11:37 -0500 |
commit | e2a8b1fd19fb3a8ead2ba28ddba27be19fa978b5 (patch) | |
tree | e5448ec45187a37dbade76fcf10115f91135a8bd /libc/include | |
parent | ede2e75f4942293342dfb8dfd4751369600ed8f1 (diff) | |
download | bionic-e2a8b1fd19fb3a8ead2ba28ddba27be19fa978b5.zip bionic-e2a8b1fd19fb3a8ead2ba28ddba27be19fa978b5.tar.gz bionic-e2a8b1fd19fb3a8ead2ba28ddba27be19fa978b5.tar.bz2 |
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
Diffstat (limited to 'libc/include')
-rw-r--r-- | libc/include/dlfcn.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/libc/include/dlfcn.h b/libc/include/dlfcn.h index 9582796..f84d1d1 100644 --- a/libc/include/dlfcn.h +++ b/libc/include/dlfcn.h @@ -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, |