summaryrefslogtreecommitdiff
path: root/src/ldso/dlinfo.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2016-01-25 18:55:35 -0500
committerRich Felker <dalias@aerifal.cx>2016-01-25 18:55:35 -0500
commitb98414732d230c236b9a79c709c2b035ca67be12 (patch)
tree99377bf63d02df0ff0190146b1606f509d16e683 /src/ldso/dlinfo.c
parentda1fe7f5008e7068f17147ee7c47e4c71a61d057 (diff)
downloadmusl-b98414732d230c236b9a79c709c2b035ca67be12.tar.gz
move dlinfo out of dynlink.c
Diffstat (limited to 'src/ldso/dlinfo.c')
-rw-r--r--src/ldso/dlinfo.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ldso/dlinfo.c b/src/ldso/dlinfo.c
index 63d276d4..a173d1ac 100644
--- a/src/ldso/dlinfo.c
+++ b/src/ldso/dlinfo.c
@@ -1,9 +1,19 @@
#define _GNU_SOURCE
#include <dlfcn.h>
-int __dlinfo(void *, int, void *);
+__attribute__((__visibility__("hidden")))
+int __dl_invalid_handle(void *);
+
+__attribute__((__visibility__("hidden")))
+void __dl_seterr(const char *, ...);
int dlinfo(void *dso, int req, void *res)
{
- return __dlinfo(dso, req, res);
+ if (__dl_invalid_handle(dso)) return -1;
+ if (req != RTLD_DI_LINKMAP) {
+ __dl_seterr("Unsupported request %d", req);
+ return -1;
+ }
+ *(struct link_map **)res = dso;
+ return 0;
}