]> git.cworth.org Git - fips/commit
fips: Fix dlsym wrapper for egl symbols
authorCarl Worth <cworth@cworth.org>
Tue, 2 Jul 2013 19:28:03 +0000 (12:28 -0700)
committerCarl Worth <cworth@cworth.org>
Wed, 3 Jul 2013 00:29:58 +0000 (17:29 -0700)
commitfd9a68595eecba23d48729bda3f470934a0048ed
treef1efc64175392b672f93c665e6312f3d4f1b2d5a
parentb0a2c9dfcde1e0f679ceec3f4801f762eb09542a
fips: Fix dlsym wrapper for egl symbols

Previously, fips was failing to provide its own wrapped versions for
functions such as eglMakeCurrent if the application was using dlsym to
locate the symbol. This led to the failure of the egl-opengl-dlopen-*
tests in the test suite.

The root of the problem was that the fips wrapper for dlopen was only
returning the libfips_handle if dlopen was requested for
"libGL.so". But here, we need to also intercept a dlopen for
"libEGL.so" as well.

However, the fix is not as simple as updating dlopen.

Previously, if dlsym failed to find a libfips-specific version of the
symbol of interest it would defer unconditionally to a call to the
real dlsym with a handle dlopened from "libGL.so". That's obviously
the wrong thing for symbols sougth from "libEGL.so". So, now, our
dlopen caches the originally dlopen'ed handles and encodes an index
into its return value so that the final dlsym can reference the
correct handle in order to find its symbol.

This commit fixes the egl-opengl-dlopen-dlsym and
egl-opengl-dlopen-gpa test cases.
dlwrap.c
fips.h