summaryrefslogtreecommitdiff
path: root/libgcompat/dlvsym.c
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2017-06-14 13:09:23 -0500
committerWilliam Pitcock <nenolod@dereferenced.org>2017-06-14 13:09:23 -0500
commitf67416822a54109bd9cfa0fd210d7d8f53412ced (patch)
tree7d3d14933f39ca160d706d1bec25ce541a188962 /libgcompat/dlvsym.c
parent2b58008b911d9dc8354b9001e22b594fa6456dd1 (diff)
downloadgcompat-f67416822a54109bd9cfa0fd210d7d8f53412ced.tar.gz
gcompat-f67416822a54109bd9cfa0fd210d7d8f53412ced.tar.bz2
gcompat-f67416822a54109bd9cfa0fd210d7d8f53412ced.tar.xz
gcompat-f67416822a54109bd9cfa0fd210d7d8f53412ced.zip
move all compatibility library stuff into libgcompat/
Diffstat (limited to 'libgcompat/dlvsym.c')
-rw-r--r--libgcompat/dlvsym.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libgcompat/dlvsym.c b/libgcompat/dlvsym.c
new file mode 100644
index 0000000..3d744ea
--- /dev/null
+++ b/libgcompat/dlvsym.c
@@ -0,0 +1,14 @@
+#include <dlfcn.h> // dlsym
+#include <stdio.h> // fprintf
+#include <stdlib.h> // getenv
+
+void *dlvsym(void *handle, char *symbol, char *version)
+{
+ if(getenv("GLIBC_FAKE_DEBUG"))
+ {
+ fprintf(stderr, "symbol %s with version %s is being redirected",
+ symbol, version);
+ }
+
+ return dlsym(handle, symbol);
+}