X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=dlwrap.c;h=dda7a77a00590e53a5101b98d6961092315ab7c3;hb=40c840f59d6d4f58c91eaa9ce9a8eb02a5cf8c6e;hp=aff9e625eda298680cc890f88061ea1845d97e65;hpb=fd9a68595eecba23d48729bda3f470934a0048ed;p=fips diff --git a/dlwrap.c b/dlwrap.c index aff9e62..dda7a77 100644 --- a/dlwrap.c +++ b/dlwrap.c @@ -29,6 +29,8 @@ #include "dlwrap.h" +#include "glwrap.h" + void *libfips_handle; typedef void * (* fips_dlopen_t)(const char * filename, int flag); @@ -36,7 +38,8 @@ typedef void * (* fips_dlsym_t)(void *handle, const char *symbol); static const char *wrapped_libs[] = { "libGL.so", - "libEGL.so" + "libEGL.so", + "libGLESv2.so" }; static void *orig_handles[ARRAY_SIZE(wrapped_libs)]; @@ -86,6 +89,13 @@ dlopen (const char *filename, int flag) if (! find_wrapped_library_index (filename, &index)) return ret; + /* When the application dlopens any wrapped library starting + * with 'libGL', (whether libGL.so.1 or libGLESv2.so.2), let's + * continue to use that library handle for future lookups of + * OpenGL functions. */ + if (STRNCMP_LITERAL (filename, "libGL") == 0) + glwrap_set_gl_handle (ret); + assert (index < ARRAY_SIZE(orig_handles)); orig_handles[index] = ret;