path: root/src/ldso/__dlsym.c
diff options
authorRich Felker <>2016-01-25 19:01:22 -0500
committerRich Felker <>2016-01-25 19:04:45 -0500
commit4058795d4938ea72a27fb3231ce52c69c7e39637 (patch)
tree4700c69e4af658e33ab0da78b4252fa69cff2bb8 /src/ldso/__dlsym.c
parent14469371cd1efd2be44f0825fec9ad8bb3216da9 (diff)
move static-linked stub dlsym out of dynlink.c
the function name is still __-prefixed because it requires an asm wrapper to pass the caller's address in order for RTLD_NEXT to work. since this was the last function in dynlink.c still used for static linking, now the whole file is conditional on SHARED being defined.
Diffstat (limited to 'src/ldso/__dlsym.c')
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ldso/__dlsym.c b/src/ldso/__dlsym.c
new file mode 100644
index 00000000..99aafdf9
--- /dev/null
+++ b/src/ldso/__dlsym.c
@@ -0,0 +1,13 @@
+#include <dlfcn.h>
+#include "libc.h"
+void __dl_seterr(const char *, ...);
+static void *stub_dlsym(void *restrict p, const char *restrict s, void *restrict ra)
+ __dl_seterr("Symbol not found: %s", s);
+ return 0;
+weak_alias(stub_dlsym, __dlsym);