This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

rtld change


Hi,

I just checked in a change to the innermost functions of the dynamic
loader.  It changes the lookup behaviour a bit, in a way I think Geoff
asked for.

Consider this program:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include <dlfcn.h>

int
main()
{
  void *h = dlopen ("/lib/libm.so.6", RTLD_LAZY);
  double (*fp) (double) = dlsym (h, "exp2");
  printf ("exp2(2) = %g\n", fp (2.0));
  return 0;
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It would fail with the old version for no really good reason.  pow2()
is introduced in glibc 2.1 and therefore has the symbol GLIBC_2.1
associated with it.  No version with GLIBC_2.0 exists.  But the lookup
mechanism checks that if we search for an unversioned symbol (as in
dlsym) that the symbol we find has the default version.  This is
probably not the best was.  What the functions now do instead is
accepting the versioned definition if it is the only definition
available.


I'm not completely satisfied with this definition either but it should
be sufficent in the moment.  At least it does not lead to surprising
results as the one above.

-- 
---------------.      drepper at gnu.org  ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Cygnus Solutions `--' drepper at cygnus.com   `------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]