Re: [PLUGIN] dlopen and RTLD_NOW

2011-09-06 Thread David Daney
On 09/06/2011 10:55 AM, David Daney wrote: On 09/05/2011 12:50 AM, Romain Geissler wrote: Hi Is there any particular reason to load plugin with the RTLD_NOW option? This option force .so symbol resolution to be completely made at load time, but this could be done only when a symbol is needed (R

Re: [PLUGIN] dlopen and RTLD_NOW

2011-09-06 Thread David Daney
On 09/05/2011 12:50 AM, Romain Geissler wrote: Hi Is there any particular reason to load plugin with the RTLD_NOW option? This option force .so symbol resolution to be completely made at load time, but this could be done only when a symbol is needed (RTLD_NOW). Here is the dlopen line in plugin

Re: [PLUGIN] dlopen and RTLD_NOW

2011-09-06 Thread Romain Geissler
2011/9/5 Jakub Jelinek : > On Mon, Sep 05, 2011 at 10:22:10AM -0700, Andrew Pinski wrote: >> On Mon, Sep 5, 2011 at 1:10 AM, Jakub Jelinek wrote: >> > That said, relying on lazy binding is terribly bad design. >> >> In fact I was going to say why can't those symbols be marked as weak >> in your pl

Re: [PLUGIN] dlopen and RTLD_NOW

2011-09-05 Thread Jakub Jelinek
On Mon, Sep 05, 2011 at 10:22:10AM -0700, Andrew Pinski wrote: > On Mon, Sep 5, 2011 at 1:10 AM, Jakub Jelinek wrote: > > That said, relying on lazy binding is terribly bad design. > > In fact I was going to say why can't those symbols be marked as weak > in your plugin? You don't even need to c

Re: [PLUGIN] dlopen and RTLD_NOW

2011-09-05 Thread Andrew Pinski
On Mon, Sep 5, 2011 at 1:10 AM, Jakub Jelinek wrote: > That said, relying on lazy binding is terribly bad design. In fact I was going to say why can't those symbols be marked as weak in your plugin? You don't even need to change the GCC headers, just have an extra header that does: #pargma weak

Re: [PLUGIN] dlopen and RTLD_NOW

2011-09-05 Thread Jakub Jelinek
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 cu

Re: [PLUGIN] dlopen and RTLD_NOW

2011-09-05 Thread Richard Guenther
On Mon, Sep 5, 2011 at 9:50 AM, Romain Geissler wrote: > Hi > > Is there any particular reason to load plugin with the RTLD_NOW option? > This option force .so symbol resolution to be completely made at load time, > but this could be done only when a symbol is needed (RTLD_NOW). > > Here is the dl

[PLUGIN] dlopen and RTLD_NOW

2011-09-05 Thread Romain Geissler
Hi Is there any particular reason to load plugin with the RTLD_NOW option? This option force .so symbol resolution to be completely made at load time, but this could be done only when a symbol is needed (RTLD_NOW). Here is the dlopen line in plugin.c: dl_handle = dlopen (plugin->full_name, RTLD_N