mirror of
https://sourceware.org/git/glibc.git
synced 2024-12-22 10:50:07 +00:00
Mon Nov 6 16:20:14 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
* elf/dlsym.c: Return the proper value, not just the defining object's loadbase.
This commit is contained in:
parent
f797c38303
commit
51093422b2
@ -1,3 +1,8 @@
|
|||||||
|
Mon Nov 6 16:20:14 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
|
* elf/dlsym.c: Return the proper value, not just the defining
|
||||||
|
object's loadbase.
|
||||||
|
|
||||||
Sun Nov 5 16:09:13 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
Sun Nov 5 16:09:13 1995 Roland McGrath <roland@churchy.gnu.ai.mit.edu>
|
||||||
|
|
||||||
* stdio-common/vfprintf.c (%c): Count the character itself towards
|
* stdio-common/vfprintf.c (%c): Count the character itself towards
|
||||||
|
@ -28,12 +28,12 @@ dlsym (void *handle, const char *name)
|
|||||||
{
|
{
|
||||||
struct link_map *map = handle;
|
struct link_map *map = handle;
|
||||||
struct link_map *real_next;
|
struct link_map *real_next;
|
||||||
Elf32_Addr value;
|
Elf32_Addr loadbase;
|
||||||
int lose;
|
int lose;
|
||||||
void doit (void)
|
void doit (void)
|
||||||
{
|
{
|
||||||
const Elf32_Sym *ref = NULL;
|
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. */
|
/* Confine the symbol scope to just this map. */
|
||||||
@ -42,5 +42,5 @@ dlsym (void *handle, const char *name)
|
|||||||
lose = _dlerror_run (doit);
|
lose = _dlerror_run (doit);
|
||||||
map->l_next = real_next;
|
map->l_next = real_next;
|
||||||
|
|
||||||
return lose ? NULL : (void *) value;
|
return lose ? NULL : (void *) (loadbase + ref->st_value);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user