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.
This commit is contained in:
Adam Jackson 2006-07-06 14:22:33 -04:00
parent 28b95fd9d1
commit 704e645207

View File

@ -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;
}