summaryrefslogtreecommitdiff
path: root/gcc/plugin.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-09 17:57:14 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-09 17:57:14 +0000
commit75abcc2ac0e798311a13d5e40d4597bdab2682d0 (patch)
tree13574a26da2449b731d606de92e0fecc392d78f1 /gcc/plugin.c
parent16146d83a7f28d47b42be6fa7fa8eeabe1c85a39 (diff)
downloadgcc-75abcc2ac0e798311a13d5e40d4597bdab2682d0.tar.gz
2009-07-09 Basile Starynkevitch <basile@starynkevitch.net>
* gcc/plugin.c (try_init_one_plugin): passes RTLD_GLOBAL to dlopen. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149424 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/plugin.c')
-rw-r--r--gcc/plugin.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/plugin.c b/gcc/plugin.c
index f6578505b88..906068387b7 100644
--- a/gcc/plugin.c
+++ b/gcc/plugin.c
@@ -592,7 +592,11 @@ try_init_one_plugin (struct plugin_name_args *plugin)
char *err;
PTR_UNION_TYPE (plugin_init_func) plugin_init_union;
- dl_handle = dlopen (plugin->full_name, RTLD_NOW);
+ /* We use RTLD_NOW to accelerate binding and detect any mismatch
+ between the API expected by the plugin and the GCC API; we use
+ RTLD_GLOBAL which is useful to plugins which themselves call
+ dlopen. */
+ dl_handle = dlopen (plugin->full_name, RTLD_NOW | RTLD_GLOBAL);
if (!dl_handle)
{
error ("Cannot load plugin %s\n%s", plugin->full_name, dlerror ());