move static-linked stub dlopen out of dynlink.c
authorRich Felker <dalias@aerifal.cx>
Mon, 25 Jan 2016 23:58:06 +0000 (18:58 -0500)
committerRich Felker <dalias@aerifal.cx>
Mon, 25 Jan 2016 23:58:06 +0000 (18:58 -0500)
src/ldso/dlopen.c [new file with mode: 0644]
src/ldso/dynlink.c

diff --git a/src/ldso/dlopen.c b/src/ldso/dlopen.c
new file mode 100644 (file)
index 0000000..dcdb439
--- /dev/null
@@ -0,0 +1,13 @@
+#include <dlfcn.h>
+#include "libc.h"
+
+__attribute__((__visibility__("hidden")))
+void __dl_seterr(const char *, ...);
+
+static void *stub_dlopen(const char *file, int mode)
+{
+       __dl_seterr("Dynamic loading not supported");
+       return 0;
+}
+
+weak_alias(stub_dlopen, dlopen);
index 2598063e836b9e38627fb7a916fa358e554e1f3a..43f86fa37a0455d649fbbb648b3fbc9b9e3253a4 100644 (file)
@@ -1914,11 +1914,6 @@ int dl_iterate_phdr(int(*callback)(struct dl_phdr_info *info, size_t size, void
        return ret;
 }
 #else
-void *dlopen(const char *file, int mode)
-{
-       error("Dynamic loading not supported");
-       return 0;
-}
 void *__dlsym(void *restrict p, const char *restrict s, void *restrict ra)
 {
        error("Symbol not found: %s", s);