Subject: Re: RTLD_GLOBAL breakage in -current
To: Todd Vierling <>
From: Paul Kranenburg <>
List: tech-toolchain
Date: 07/14/1998 22:43:28
> The changes to the interface to make RTLD_LOCAL the default breaks
> binary compatibility with any program (the big one biting me is perl) which
> assumes that the lack of RTLD_GLOBAL in <dlfcn.h> means that it's on by
> default.  My dynamic Perl modules which depend on dlopen()ed libraries are
> breaking now that I've updated to -current.  JDK is also breaking, as
> is Mozilla.
> Charles suggested to me that we could check the _DYNAMIC version number to
> determine whether to turn on RTLD_GLOBAL by default.  I'm not quite sure if
> the _DYNAMIC number changed, or even where that value is set.

The version number was not incremented for this change. This can be done
by defining a new CRT interface number in <link.h> which all newly
linked programs will then use.

Strictly speaking, this is not enough to guarantee binary compatibility
in all cases, since object files and libraries may exist that were
compiled under the old conditions. Those should be recompiled.

> It hit me, as well, that there is likely software out there that assumes
> "NetBSD == RTLD_GLOBAL by default."  Since the more "standardized" (is it
> standardized?) implementations out there specify that one of either
> RTLD_LOCAL or RTLD_GLOBAL should be specified, I'd propose that the default
> behavior be changed back to RTLD_GLOBAL, and that RTLD_LOCAL be made into
> the flag which changes behavior.

The RTLD_LOCAL flag came in per `XSH98'. It seems logical we consult that
document for an acceptable default behaviour.