From 82eef55f8fad3e00c53050de5d6ebea08df488b3 Mon Sep 17 00:00:00 2001 From: Florian Weimer Date: Thu, 4 Jan 2018 18:46:17 +0100 Subject: elf: Support dlvsym within libc.so This commit adds a new _dl_open_hook entry for dlvsym and implements the function using the existing dl_lookup_symbol_x function supplied by the dynamic loader. A new hook variable, _dl_open_hook2, is introduced, which should make this change suitable for backporting: For old statically linked binaries, __libc_dlvsym will always return NULL. --- include/dlfcn.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/dlfcn.h') diff --git a/include/dlfcn.h b/include/dlfcn.h index 526086f1a0..12ef913e19 100644 --- a/include/dlfcn.h +++ b/include/dlfcn.h @@ -35,9 +35,11 @@ extern char **__libc_argv attribute_hidden; __libc_dlopen_mode (name, RTLD_LAZY | __RTLD_DLOPEN) extern void *__libc_dlopen_mode (const char *__name, int __mode); extern void *__libc_dlsym (void *__map, const char *__name); +extern void *__libc_dlvsym (void *map, const char *name, const char *version); extern int __libc_dlclose (void *__map); libc_hidden_proto (__libc_dlopen_mode) libc_hidden_proto (__libc_dlsym) +libc_hidden_proto (__libc_dlvsym) libc_hidden_proto (__libc_dlclose) /* Locate shared object containing the given address. */ -- cgit 1.4.1