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 (RTLD_NOW).

Here is the dlopen line in plugin.c:
dl_handle = dlopen (plugin->full_name, RTLD_NOW | RTLD_GLOBAL);

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.

Can you supply weak binding implementations for the missing functions?
That might allow the linking to succeed.

... And if I read the entire thread before responding, I would have seen 
that others had already suggested the same thing.
Sorry for the noise.

David Daney

Reply via email to