summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2014-05-29 13:32:21 -0400
committerIan Romanick <ian.d.romanick@intel.com>2014-05-29 15:48:53 -0700
commit7ab2363c11d474ec0bcdc04cb14d4a5eedfa3bac (patch)
tree07dd3af978514dac8b0390b7c1319e979020a085
parent55b9effa4a23755232e433d3da4f422a1f74fd82 (diff)
glx: load dri driver with RTLD_LOCAL so dlclose never fails to unload
There is no reason anymore to load with RTLD_GLOBAL and for some driver this even result in dlclose failing to unload leading to catastrophic failure with swrast fallback. Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Signed-off-by: Jérôme Glisse <jglisse@redhat.com> (cherry picked from commit e3cc0d90e14e62a0a787b6c07a6df0f5c84039be)
-rw-r--r--src/glx/dri_common.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c
index 8bf47054a32..e5a3f7070aa 100644
--- a/src/glx/dri_common.c
+++ b/src/glx/dri_common.c
@@ -45,8 +45,8 @@
#ifndef RTLD_NOW
#define RTLD_NOW 0
#endif
-#ifndef RTLD_GLOBAL
-#define RTLD_GLOBAL 0
+#ifndef RTLD_LOCAL
+#define RTLD_LOCAL 0
#endif
_X_HIDDEN void
@@ -99,7 +99,7 @@ driOpenDriver(const char *driverName)
int len;
/* Attempt to make sure libGL symbols will be visible to the driver */
- glhandle = dlopen("libGL.so.1", RTLD_NOW | RTLD_GLOBAL);
+ glhandle = dlopen("libGL.so.1", RTLD_NOW | RTLD_LOCAL);
libPaths = NULL;
if (geteuid() == getuid()) {
@@ -127,14 +127,14 @@ driOpenDriver(const char *driverName)
snprintf(realDriverName, sizeof realDriverName,
"%.*s/tls/%s_dri.so", len, p, driverName);
InfoMessageF("OpenDriver: trying %s\n", realDriverName);
- handle = dlopen(realDriverName, RTLD_NOW | RTLD_GLOBAL);
+ handle = dlopen(realDriverName, RTLD_NOW | RTLD_LOCAL);
#endif
if (handle == NULL) {
snprintf(realDriverName, sizeof realDriverName,
"%.*s/%s_dri.so", len, p, driverName);
InfoMessageF("OpenDriver: trying %s\n", realDriverName);
- handle = dlopen(realDriverName, RTLD_NOW | RTLD_GLOBAL);
+ handle = dlopen(realDriverName, RTLD_NOW | RTLD_LOCAL);
}
if (handle != NULL)