elf: Support dlvsym within libc.so

System Internals / glibc - Florian Weimer [redhat.com] - 4 January 2018 17:46 EST

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.

82eef55f8f elf: Support dlvsym within libc.so
ChangeLog | 25 +++++++++
elf/Makefile | 16 ++++--
elf/Versions | 4 +-
elf/dl-libc.c | 73 ++++++++++++++++++++++++-
elf/tst-libc_dlvsym-dso.c | 25 +++++++++
elf/tst-libc_dlvsym-static.c | 32 +++++++++++
elf/tst-libc_dlvsym.c | 34 ++++++++++++
elf/tst-libc_dlvsym.h | 125 +++++++++++++++++++++++++++++++++++++++++++
include/dlfcn.h | 2 +
9 files changed, 330 insertions(+), 6 deletions(-)

Upstream: sourceware.org


  • Share