dlsym(RTLD_NEXT) and weak symbols

From: Maxim Sobolev <sobomax_at_FreeBSD.org>
Date: Wed, 08 Oct 2008 14:36:42 -0700
Hi,

I am not sure if it has even worked correctly, but calling 
dlsym("dlopen", RTLD_NEXT) returns reference to the dlopen() function in 
the libc, not reference to dlopen() function in the ld-elf.so. The 
attempt to call this function then fails, since dlopen() in libc is just 
a stub to make static linking happy.

#pragma weak dlopen
void *
dlopen(const char *name, int mode)
{
         _rtld_error(sorry);
         return NULL;
}

IMHO this is incorrect and is probably part of the bigger problem. The 
dlsym(3) should return first non-weak symbol instead.

-Maxim
Received on Wed Oct 08 2008 - 19:36:51 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:36 UTC