diff options
author | Iliyan Malchev <malchev@google.com> | 2009-09-28 18:21:30 -0700 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2009-09-29 14:33:46 -0700 |
commit | 9ea64da6c511e8f9f4edae4c10c20879957631ab (patch) | |
tree | 11adf7525e859f87f980f7836936c30570213446 /linker/dlfcn.c | |
parent | 6ed80c8814db9eed1fb687be22322e38dc46a2fb (diff) | |
download | bionic-9ea64da6c511e8f9f4edae4c10c20879957631ab.zip bionic-9ea64da6c511e8f9f4edae4c10c20879957631ab.tar.gz bionic-9ea64da6c511e8f9f4edae4c10c20879957631ab.tar.bz2 |
bionic/linker: change lookup() to return soinfo, not base
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 b54674f..053713c 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; } |