Re: dlopen() without RTLD_GLOBAL



Tim Janik wrote:

On 2 May 2002, Havoc Pennington wrote:

Hi,

gdk-pixbuf and the like should definitely not be using RTLD_GLOBAL, on platforms that support dlopen() with private symbols.
Using RTLD_GLOBAL has the effect of stuffing all those image libs into
our ABI, which kind of sucks.

If we're doing a GLib 2.2, suggest that we add a
G_MODULE_LOCAL_SYMBOLS flag to GModuleFlags.

one of the reasons to not have such a flag in the initial implementation
was that not all systems do support user defined scope specification.
gmodule-dl.c has more comments on this, and configure.in checks for
RTLD_GLOBAL borkeness on at least OSF1/5.0.
(the same holds for G_MODULE_BIND_LAZY, but isn't as much of a problem
since lazy resolution of symbols is more of a hint and doesn't necessarily
break things if not honoured).

the demand to load modules with non-global symbols has popped up often
enough to justify it's implementations though, but users (docs) need to
be aware that G_MODULE_BIND_LOCAL (that's the flag name we should actually
use) isn't correctly honoured on all systems.
That doesn't sound like too much of a problem. We already use a few features to limit what goes in the global symbol table that don't work correctly (such as the libtool -export-dynamic flag, which doesn't work on Linux).

James.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]