Blame SOURCES/0005-loader-Make-LoaderSymbolFromModule-take-a-ModuleDesc.patch

55d6a0
From b01ca791b9ba62e25e3533ba35f8e825f02f0f80 Mon Sep 17 00:00:00 2001
55d6a0
From: Adam Jackson <ajax@redhat.com>
55d6a0
Date: Mon, 18 Nov 2019 16:43:50 -0500
55d6a0
Subject: [PATCH xserver 05/11] loader: Make LoaderSymbolFromModule take a
55d6a0
 ModuleDescPtr
55d6a0
MIME-Version: 1.0
55d6a0
Content-Type: text/plain; charset=UTF-8
55d6a0
Content-Transfer-Encoding: 8bit
55d6a0
55d6a0
The thing you get back from xf86LoadSubModule is a ModuleDescPtr, not a
55d6a0
dlsym handle. We don't expose ModuleDescPtr to the drivers, so change
55d6a0
LoaderSymbolFromModule to cast its void * argument to a ModuleDescPtr.
55d6a0
55d6a0
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
55d6a0
(cherry picked from commit ab61c16ef07fde6eb7110c63c344c54eb2a2d117)
55d6a0
---
55d6a0
 hw/xfree86/loader/loader.c  | 3 ++-
55d6a0
 hw/xfree86/loader/loadmod.c | 2 +-
55d6a0
 2 files changed, 3 insertions(+), 2 deletions(-)
55d6a0
55d6a0
diff --git a/hw/xfree86/loader/loader.c b/hw/xfree86/loader/loader.c
55d6a0
index 503c47e3a..2580e93d9 100644
55d6a0
--- a/hw/xfree86/loader/loader.c
55d6a0
+++ b/hw/xfree86/loader/loader.c
55d6a0
@@ -135,7 +135,8 @@ LoaderSymbol(const char *name)
55d6a0
 void *
55d6a0
 LoaderSymbolFromModule(void *handle, const char *name)
55d6a0
 {
55d6a0
-    return dlsym(handle, name);
55d6a0
+    ModuleDescPtr mod = handle;
55d6a0
+    return dlsym(mod->handle, name);
55d6a0
 }
55d6a0
 
55d6a0
 void
55d6a0
diff --git a/hw/xfree86/loader/loadmod.c b/hw/xfree86/loader/loadmod.c
55d6a0
index a93a76aa9..81a3a1dd9 100644
55d6a0
--- a/hw/xfree86/loader/loadmod.c
55d6a0
+++ b/hw/xfree86/loader/loadmod.c
55d6a0
@@ -776,7 +776,7 @@ LoadModule(const char *module, void *options, const XF86ModReqInfo *modreq,
55d6a0
             *errmaj = LDR_NOMEM;
55d6a0
         goto LoadModule_fail;
55d6a0
     }
55d6a0
-    initdata = LoaderSymbolFromModule(ret->handle, p);
55d6a0
+    initdata = LoaderSymbolFromModule(ret, p);
55d6a0
     if (initdata) {
55d6a0
         ModuleSetupProc setup;
55d6a0
         ModuleTearDownProc teardown;
55d6a0
-- 
55d6a0
2.33.1
55d6a0