aboutsummaryrefslogtreecommitdiff
path: root/elf/dlsym.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1995-11-07 10:00:21 +0000
committerRoland McGrath <roland@gnu.org>1995-11-07 10:00:21 +0000
commit51093422b2ea7d61c17e4ac55af61ba9558d18d4 (patch)
treee3bbdca2b04a109edf84132db5b2f620d922e645 /elf/dlsym.c
parentf797c38303ce47438416a100e4d4671b56ffa528 (diff)
downloadglibc-51093422b2ea7d61c17e4ac55af61ba9558d18d4.zip
glibc-51093422b2ea7d61c17e4ac55af61ba9558d18d4.tar.gz
glibc-51093422b2ea7d61c17e4ac55af61ba9558d18d4.tar.bz2
Mon Nov 6 16:20:14 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>cvs/libc-951107
* elf/dlsym.c: Return the proper value, not just the defining object's loadbase.
Diffstat (limited to 'elf/dlsym.c')
-rw-r--r--elf/dlsym.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/elf/dlsym.c b/elf/dlsym.c
index 40ed850..8277ca3 100644
--- a/elf/dlsym.c
+++ b/elf/dlsym.c
@@ -28,12 +28,12 @@ dlsym (void *handle, const char *name)
{
struct link_map *map = handle;
struct link_map *real_next;
- Elf32_Addr value;
+ Elf32_Addr loadbase;
int lose;
void doit (void)
{
const Elf32_Sym *ref = NULL;
- value = _dl_lookup_symbol (name, &ref, map, map->l_name, 1);
+ loadbase = _dl_lookup_symbol (name, &ref, map, map->l_name, 1);
}
/* Confine the symbol scope to just this map. */
@@ -42,5 +42,5 @@ dlsym (void *handle, const char *name)
lose = _dlerror_run (doit);
map->l_next = real_next;
- return lose ? NULL : (void *) value;
+ return lose ? NULL : (void *) (loadbase + ref->st_value);
}