diff options
| author | Jean-Baptiste Queru <jbq@google.com> | 2009-11-15 12:05:31 -0800 |
|---|---|---|
| committer | Jean-Baptiste Queru <jbq@google.com> | 2009-11-15 12:05:31 -0800 |
| commit | 95604529ec25fe7923ba88312c590f38aa5e3d9e (patch) | |
| tree | c6f1dd860fcdc273ab21b696778987261f6e4fa8 /linker/dlfcn.c | |
| parent | 71c0aeb44f2301af85d6a370dbd7308602a1dfe0 (diff) | |
| parent | 194d3fa048cf909ca592dd56fa538dc9cd3f5ddb (diff) | |
| download | bionic-95604529ec25fe7923ba88312c590f38aa5e3d9e.zip bionic-95604529ec25fe7923ba88312c590f38aa5e3d9e.tar.gz bionic-95604529ec25fe7923ba88312c590f38aa5e3d9e.tar.bz2 | |
merge from eclair
Diffstat (limited to 'linker/dlfcn.c')
| -rw-r--r-- | linker/dlfcn.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/linker/dlfcn.c b/linker/dlfcn.c index 611bfd3..039926c 100644 --- a/linker/dlfcn.c +++ b/linker/dlfcn.c @@ -74,7 +74,7 @@ const char *dlerror(void) void *dlsym(void *handle, const char *symbol) { - unsigned base; + soinfo *found; Elf32_Sym *sym; unsigned bind; @@ -90,19 +90,19 @@ void *dlsym(void *handle, const char *symbol) } if(handle == RTLD_DEFAULT) { - sym = lookup(symbol, &base); + sym = lookup(symbol, &found); } else if(handle == RTLD_NEXT) { - sym = lookup(symbol, &base); + sym = lookup(symbol, &found); } else { - sym = lookup_in_library((soinfo*) handle, symbol); - base = ((soinfo*) handle)->base; + found = (soinfo*)handle; + sym = lookup_in_library(found, symbol); } if(likely(sym != 0)) { bind = ELF32_ST_BIND(sym->st_info); if(likely((bind == STB_GLOBAL) && (sym->st_shndx != 0))) { - unsigned ret = sym->st_value + base; + unsigned ret = sym->st_value + found->base; pthread_mutex_unlock(&dl_lock); return (void*)ret; } |
