mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-29 11:41:21 +03:00
(__libc_dlsym_private, __libc_register_dl_open_hook): New functions. (__libc_dlopen_mode): Call __libc_register_dl_open_hook and __libc_register_dlfcn_hook.
This commit is contained in:
@ -121,7 +121,6 @@ do_dlsym_private (void *ptr)
|
|||||||
vers.hidden = 1;
|
vers.hidden = 1;
|
||||||
/* vers.hash = _dl_elf_hash (version); */
|
/* vers.hash = _dl_elf_hash (version); */
|
||||||
vers.hash = 0x0963cf85;
|
vers.hash = 0x0963cf85;
|
||||||
/* FIXME: Shouldn't we use libc.so.6* here? */
|
|
||||||
vers.filename = NULL;
|
vers.filename = NULL;
|
||||||
|
|
||||||
struct do_dlsym_args *args = (struct do_dlsym_args *) ptr;
|
struct do_dlsym_args *args = (struct do_dlsym_args *) ptr;
|
||||||
@ -156,24 +155,37 @@ __libc_dlopen_mode (const char *name, int mode)
|
|||||||
if (dlerror_run (do_dlopen, &args))
|
if (dlerror_run (do_dlopen, &args))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
struct do_dlsym_args sargs;
|
__libc_register_dl_open_hook (args.map);
|
||||||
sargs.map = args.map;
|
__libc_register_dlfcn_hook (args.map);
|
||||||
sargs.name = "_dl_open_hook";
|
|
||||||
|
|
||||||
if (! dlerror_run (do_dlsym_private, &sargs))
|
|
||||||
{
|
|
||||||
struct dl_open_hook **hook
|
|
||||||
= (struct dl_open_hook **)
|
|
||||||
(DL_SYMBOL_ADDRESS (sargs.loadbase, sargs.ref));
|
|
||||||
if (hook != NULL)
|
|
||||||
*hook = &_dl_open_hook;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (void *) args.map;
|
return (void *) args.map;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
libc_hidden_def (__libc_dlopen_mode)
|
libc_hidden_def (__libc_dlopen_mode)
|
||||||
|
|
||||||
|
#ifndef SHARED
|
||||||
|
void *
|
||||||
|
__libc_dlsym_private (struct link_map *map, const char *name)
|
||||||
|
{
|
||||||
|
struct do_dlsym_args sargs;
|
||||||
|
sargs.map = map;
|
||||||
|
sargs.name = name;
|
||||||
|
|
||||||
|
if (! dlerror_run (do_dlsym_private, &sargs))
|
||||||
|
return DL_SYMBOL_ADDRESS (sargs.loadbase, sargs.ref);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
__libc_register_dl_open_hook (struct link_map *map)
|
||||||
|
{
|
||||||
|
struct dl_open_hook **hook;
|
||||||
|
|
||||||
|
hook = (struct dl_open_hook **) __libc_dlsym_private (map, "_dl_open_hook");
|
||||||
|
if (hook != NULL)
|
||||||
|
*hook = &_dl_open_hook;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void *
|
void *
|
||||||
__libc_dlsym (void *map, const char *name)
|
__libc_dlsym (void *map, const char *name)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user