loader: Use RTLD_LOCAL not RTLD_GLOBAL

The gallium driver does not expose any symbols that anybody else wants
to see. But if we load it with RTLD_GLOBAL that's what happens, along
with all the symbols in the libraries it depends on.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30417>
This commit is contained in:
Adam Jackson 2024-07-29 12:25:16 -04:00 committed by Marge Bot
parent bc811a602e
commit 9a610c5ab9

View file

@ -858,7 +858,7 @@ loader_open_driver_lib(const char *driver_name,
len = next - p;
snprintf(path, sizeof(path), "%.*s/%s%s.so", len,
p, driver_name, lib_suffix);
driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
driver = dlopen(path, RTLD_NOW | RTLD_LOCAL);
if (driver == NULL) {
dl_error = dlerror();
log_(_LOADER_DEBUG, "MESA-LOADER: failed to open %s: %s\n",