loader: Make LoaderSymbolFromModule take a ModuleDescPtr

The thing you get back from xf86LoadSubModule is a ModuleDescPtr, not a
dlsym handle. We don't expose ModuleDescPtr to the drivers, so change
LoaderSymbolFromModule to cast its void * argument to a ModuleDescPtr.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
This commit is contained in:
Adam Jackson 2019-11-18 16:43:50 -05:00
parent 4308f5d3d1
commit ab61c16ef0
2 changed files with 3 additions and 2 deletions

View File

@ -135,7 +135,8 @@ LoaderSymbol(const char *name)
void *
LoaderSymbolFromModule(void *handle, const char *name)
{
return dlsym(handle, name);
ModuleDescPtr mod = handle;
return dlsym(mod->handle, name);
}
void

View File

@ -776,7 +776,7 @@ LoadModule(const char *module, void *options, const XF86ModReqInfo *modreq,
*errmaj = LDR_NOMEM;
goto LoadModule_fail;
}
initdata = LoaderSymbolFromModule(ret->handle, p);
initdata = LoaderSymbolFromModule(ret, p);
if (initdata) {
ModuleSetupProc setup;
ModuleTearDownProc teardown;