From 6b76a7129903ab3726ec0217349b526262bec3ac Mon Sep 17 00:00:00 2001 From: Bernhard Reutner-Fischer Date: Tue, 14 Jun 2011 16:48:51 +0200 Subject: libdl: search for ELF_RTYPE_CLASS_DLSYM in dlsym() On FDPIC platforms, functions are passed by function descriptor, not by pointers. If you don't specify ELF_RTYPE_CLASS_DLSYM when calling _dl_find_hash() the return value from dlsym() will be a pointer not a function descriptor, crashing the program. The bug was introduced when TLS support was added in 534661b91c98492995274c364c8177c45efc63db Closes bug#3433 Signed-off-by: Bernhard Reutner-Fischer --- ldso/libdl/libdl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ldso/libdl') diff --git a/ldso/libdl/libdl.c b/ldso/libdl/libdl.c index 52c77b00a..f59889c99 100644 --- a/ldso/libdl/libdl.c +++ b/ldso/libdl/libdl.c @@ -667,7 +667,7 @@ void *dlsym(void *vhandle, const char *name) tpnt = NULL; if (handle == _dl_symbol_tables) tpnt = handle->dyn; /* Only search RTLD_GLOBAL objs if global object */ - ret = _dl_find_hash(name2, handle, tpnt, 0, &sym_ref); + ret = _dl_find_hash(name2, handle, tpnt, ELF_RTYPE_CLASS_DLSYM, &sym_ref); #if defined(USE_TLS) && USE_TLS && defined SHARED if (sym_ref.tpnt) { -- cgit v1.2.3