Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 08 Oct 2008 14:36:42 -0700
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        Alexander Kabaev <kan@FreeBSD.org>
Cc:        "current@freebsd.org" <current@FreeBSD.org>
Subject:   dlsym(RTLD_NEXT) and weak symbols
Message-ID:  <48ED27EA.9020407@FreeBSD.org>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48ED27EA.9020407>