summaryrefslogtreecommitdiff
path: root/src/ldso/dlerror.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2016-01-25 18:51:33 -0500
committerRich Felker <dalias@aerifal.cx>2016-01-25 18:51:33 -0500
commit891e6547b4fdec10fe4ffa3b1ef5ddb524bcde39 (patch)
tree719297d6a87f705f73a38e1f4cf5783206c2811c /src/ldso/dlerror.c
parent4f8f038060739eca4c5cb97bb067529be96658d2 (diff)
downloadmusl-891e6547b4fdec10fe4ffa3b1ef5ddb524bcde39.tar.gz
move static-linked stub invalid dso handle checking out of dynlink.c
Diffstat (limited to 'src/ldso/dlerror.c')
-rw-r--r--src/ldso/dlerror.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ldso/dlerror.c b/src/ldso/dlerror.c
index 588828e9..378f0356 100644
--- a/src/ldso/dlerror.c
+++ b/src/ldso/dlerror.c
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include <stdarg.h>
#include "pthread_impl.h"
+#include "libc.h"
char *dlerror()
{
@@ -50,3 +51,14 @@ void __dl_seterr(const char *fmt, ...)
__dl_vseterr(fmt, ap);
va_end(ap);
}
+
+__attribute__((__visibility__("hidden")))
+int __dl_invalid_handle(void *);
+
+static int stub_invalid_handle(void *h)
+{
+ __dl_seterr("Invalid library handle %p", (void *)h);
+ return 1;
+}
+
+weak_alias(stub_invalid_handle, __dl_invalid_handle);