diff --git a/glx/glxdricommon.c b/glx/glxdricommon.c index 1baf082cf..2e00bab03 100644 --- a/glx/glxdricommon.c +++ b/glx/glxdricommon.c @@ -27,6 +27,7 @@ #include #endif +#include #include #include #include @@ -322,6 +323,15 @@ glxProbeDriver(const char *driverName, __DRI_DRIVER_GET_EXTENSIONS, driverName) != -1) { const __DRIextension **(*get_extensions)(void); + for (i = 0; i < strlen(get_extensions_name); i++) { + /* Replace all non-alphanumeric characters with underscore, + * since they are not allowed in C symbol names. That fixes up + * symbol name for drivers with '-drm' suffix + */ + if (!isalnum(get_extensions_name[i])) + get_extensions_name[i] = '_'; + } + get_extensions = dlsym(driver, get_extensions_name); if (get_extensions) extensions = get_extensions();