]> git.alsa-project.org Git - alsa-lib.git/commitdiff
Added a lookup for exact ALSA library binary to allow RTLD_LOCAL usage
authorJaroslav Kysela <perex@perex.cz>
Tue, 17 Sep 2002 15:28:41 +0000 (15:28 +0000)
committerJaroslav Kysela <perex@perex.cz>
Tue, 17 Sep 2002 15:28:41 +0000 (15:28 +0000)
src/dlmisc.c

index ed749d3ff578fc55995d93caab7a2a62d54513bf..a5d174d7a7b51b094fc9ba331299a7d31d75240c 100644 (file)
@@ -27,6 +27,7 @@
  *
  */
 
+#define _GNU_SOURCE
 #include <dlfcn.h>
 #include "local.h"
 
@@ -50,6 +51,12 @@ void *snd_dlopen(const char *name, int mode)
 #ifndef PIC
        if (name == NULL)
                return &snd_dlsym_start;
+#else
+       if (name == NULL) {
+               Dl_info dlinfo;
+               if (dladdr(snd_dlopen, &dlinfo) > 0)
+                       name = dlinfo.dli_fname;
+       }
 #endif
        return dlopen(name, mode);
 }