From: Jaroslav Kysela Date: Tue, 17 Sep 2002 15:28:41 +0000 (+0000) Subject: Added a lookup for exact ALSA library binary to allow RTLD_LOCAL usage X-Git-Tag: v1.0.3~385 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=4dbdc06809e8bc4a6dc30fa5ec7b9772be5ae2de;p=alsa-lib.git Added a lookup for exact ALSA library binary to allow RTLD_LOCAL usage --- diff --git a/src/dlmisc.c b/src/dlmisc.c index ed749d3f..a5d174d7 100644 --- a/src/dlmisc.c +++ b/src/dlmisc.c @@ -27,6 +27,7 @@ * */ +#define _GNU_SOURCE #include #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); }