Fix a handling of dlsym(RTLD_NEXT) without loading libGL. Closes #1463

* The original fix leads to infinite recursion in GLX, EGL hooks.
  Due to `dlopen` function override in `librenderdoc.so` library the
  `Process::LoadModule` function always returns a handle of
  `librenderdoc.so` instead of requested library. So instead of
  `real function` we receive an address of the `hook` that leads
  to the infinite recursion in this `hook`.

Fixes: 6d40bbb ('Add experimental wayland support. Refs #853')
Tested-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
This commit is contained in:
Andrii Simiklit
2020-01-08 17:51:13 +02:00
committed by Baldur Karlsson
parent 45fbb7b06d
commit 6ba58f153d
2 changed files with 4 additions and 2 deletions
+2 -1
View File
@@ -143,7 +143,8 @@ static void EnsureRealLibraryLoaded()
if(!handle)
handle = Process::LoadModule("libEGL.so.1");
eglhook.handle = handle;
if(RenderDoc::Inst().IsReplayApp())
eglhook.handle = handle;
}
#endif
}
+2 -1
View File
@@ -76,7 +76,8 @@ static void EnsureRealLibraryLoaded()
if(!handle)
handle = Process::LoadModule("libGLX.so.0");
glxhook.handle = handle;
if(RenderDoc::Inst().IsReplayApp())
glxhook.handle = handle;
}
}