Making the real_dlopen variable static means that we perform the dlysm
lookup only once and then re-use the result for later calls. This is
what was always intended for this code.
void *
dlwrap_real_dlopen (const char *filename, int flag)
{
void *
dlwrap_real_dlopen (const char *filename, int flag)
{
- fips_dlopen_t real_dlopen = NULL;
+ static fips_dlopen_t real_dlopen = NULL;
if (! real_dlopen) {
real_dlopen = (fips_dlopen_t) dlwrap_real_dlsym (RTLD_NEXT, "dlopen");
if (! real_dlopen) {
real_dlopen = (fips_dlopen_t) dlwrap_real_dlsym (RTLD_NEXT, "dlopen");