engine: platform: posix: use RTLD_NOW instead of lazy.

It actually was a misconception coming from old engine fork
We want to track unresolved symbols before library could be loaded

Also, disable "symbol not found" spam in FunctionFromName. Due to how
savefile mangling convert works and compatibility with GoldSrc saves,
this function is used to bruteforce possible symbol names.
This commit is contained in:
Alibek Omarov 2022-07-13 19:23:45 +03:00
parent a2d11f670a
commit 5e1f189db3
1 changed files with 3 additions and 8 deletions

View File

@ -102,7 +102,7 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d
// try to find by linker(LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, LD_32_LIBRARY_PATH and so on...)
if( !pHandle )
{
pHandle = dlopen( dllname, RTLD_LAZY );
pHandle = dlopen( dllname, RTLD_NOW );
if( pHandle )
return pHandle;
@ -139,7 +139,7 @@ void *COM_LoadLibrary( const char *dllname, int build_ordinals_table, qboolean d
else
#endif
{
if( !( hInst->hInstance = dlopen( hInst->fullPath, RTLD_LAZY ) ) )
if( !( hInst->hInstance = dlopen( hInst->fullPath, RTLD_NOW ) ) )
{
COM_PushLibraryError( dlerror() );
Mem_Free( hInst );
@ -188,12 +188,7 @@ void *COM_GetProcAddress( void *hInstance, const char *name )
void *COM_FunctionFromName( void *hInstance, const char *pName )
{
void *function;
if( !( function = COM_GetProcAddress( hInstance, pName ) ) )
{
Con_Reportf( S_ERROR "FunctionFromName: Can't get symbol %s: %s\n", pName, dlerror());
}
return function;
return COM_GetProcAddress( hInstance, pName );
}
#ifdef XASH_DYNAMIC_DLADDR