summaryrefslogtreecommitdiff
path: root/libgcompat/dlfcn.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgcompat/dlfcn.c')
-rw-r--r--libgcompat/dlfcn.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/libgcompat/dlfcn.c b/libgcompat/dlfcn.c
new file mode 100644
index 0000000..f2eaa45
--- /dev/null
+++ b/libgcompat/dlfcn.c
@@ -0,0 +1,25 @@
+#include <dlfcn.h> /* dlopen, dlsym */
+#include <stddef.h> /* NULL */
+#include <stdio.h> /* fprintf */
+#include <stdlib.h> /* getenv */
+
+void *dlmopen(long lmid, const char *pathname, int mode)
+{
+ if (getenv("GLIBC_FAKE_DEBUG") != NULL) {
+ fprintf(stderr,
+ "loading library %s was requested in namespace %ld",
+ pathname, lmid);
+ }
+
+ return dlopen(pathname, mode);
+}
+
+void *dlvsym(void *handle, char *symbol, char *version)
+{
+ if (getenv("GLIBC_FAKE_DEBUG") != NULL) {
+ fprintf(stderr, "symbol %s with version %s is being redirected",
+ symbol, version);
+ }
+
+ return dlsym(handle, symbol);
+}