Subject: Re: Behavior of dlopen(NULL, 0)
To: Julio M. Merino Vidal <>
From: Martin Husemann <>
List: tech-userlevel
Date: 04/17/2004 00:17:16
On Fri, Apr 16, 2004 at 11:50:04PM +0200, Julio M. Merino Vidal wrote:
>      If the first argument is NULL, dlopen() returns a handle on
>      the global symbol object. This object provides access to all symbols from
>      an ordered set of objects consisting of the original program image and
>      any dependencies loaded during startup.
>                                     ^^^^^^^

This is correct, and wording pretty similar to SUS, but the next part is
missing in our man page:

  and the set of objects loaded using a dlopen() operation together with the
  RTLD_GLOBAL flag. As the latter set of objects can change during execution,
  the set identified by handle can also change dynamically.

and the description of RTLD_GLOBAL:

  The object's symbols shall be made available for the relocation processing of
  any other object. In addition, symbol lookup using dlopen(0, mode) and an
  associated dlsym() allows objects loaded with this mode to be searched.

So our man page and implementation are missing RTLD_GLOBAL, and I think there
is already a PR for that.

The test program looks OK to me.