Subject: Re: Question about dlsym() and lib searching
To: Dave Huang <>
From: Paul Kranenburg <>
List: tech-userlevel
Date: 05/03/1997 10:13:31
> I took a look at rtld.c, and it looks like dlopen() is supposed to set
> some RTLD_DL flag, which dlsym() will then use to restrict the search
> to just that one library. But apparently, since libc is already open,
> dlopen() just returns a handle to the existing library, and returns
> without setting that flag.

A fix for this has just been committed.

I use a slightly different approach to determine the scope of dlsym()
symbol lookups. The special case `dlopen(NULL, ..)' now returns a
magic token, as it is currently the only case which requires lookups
to be done in the entire library space.