From 704e645207d88a2d0a372cf69f6abd778ed4c30b Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Thu, 6 Jul 2006 14:22:33 -0400 Subject: [PATCH] Remind dlloader that it needs to search the global scope as well as the loaded modules. Fixes LoaderSymbol() on symbols provided by the server. Spotted by Aaron Plattner. --- hw/xfree86/loader/dlloader.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/xfree86/loader/dlloader.c b/hw/xfree86/loader/dlloader.c index 3c62f863b..7db04b1a0 100644 --- a/hw/xfree86/loader/dlloader.c +++ b/hw/xfree86/loader/dlloader.c @@ -105,6 +105,8 @@ DLFindSymbolLocal(pointer module, const char *name) return p; } +static void *global_scope = NULL; + void * DLFindSymbol(const char *name) { @@ -117,6 +119,12 @@ DLFindSymbol(const char *name) return p; } + if (!global_scope) + global_scope = dlopen(NULL, DLOPEN_LAZY | DLOPEN_GLOBAL); + + if (global_scope) + return dlsym(global_scope, name); + return NULL; }