On Mon, Sep 05, 2011 at 09:51:34AM +0200, Richard Guenther wrote: > > My issue is, I want to load the same plugin.so in both cc1 and cc1plus, but > > in the C++ case, I may need to reference some cc1plus specific symbols. I > > can > > check whether cc1 or cc1plus loaded the plugin and thus use custom C++ > > symbols only when present. With RTLD_NOW, the plugin fails to load in cc1 as > > symbol resolution is forced at load time. > > > > If RTLD_NOW is removed, dlopen falls back to the RTLD_LAZY mode which fits > > my need. Moreover, if one can force the complete symbol resolution at load > > time > > by defining the environment LD_BIND_NOW variable. > > > > So, is RTLD_NOW use justified ? > > Not really, neither RTLD_GLOBAL.
That said, relying on lazy binding is terribly bad design. Jakub