move dlinfo out of dynlink.c
authorRich Felker <dalias@aerifal.cx>
Mon, 25 Jan 2016 23:55:35 +0000 (18:55 -0500)
committerRich Felker <dalias@aerifal.cx>
Mon, 25 Jan 2016 23:55:35 +0000 (18:55 -0500)
src/ldso/dlinfo.c
src/ldso/dynlink.c

index 63d276d408e34fe667476f43dd41bdf8da0deb4f..a173d1ac63ef1294decefa6b00db9a9bd7f35ce6 100644 (file)
@@ -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;
 }
index d2c5c3f6b2876f62129ba56cc40ad1a94593c3fe..2598063e836b9e38627fb7a916fa358e554e1f3a 100644 (file)
@@ -1926,20 +1926,6 @@ void *__dlsym(void *restrict p, const char *restrict s, void *restrict ra)
 }
 #endif
 
-__attribute__((__visibility__("hidden")))
-int __dl_invalid_handle(void *);
-
-int __dlinfo(void *dso, int req, void *res)
-{
-       if (__dl_invalid_handle(dso)) return -1;
-       if (req != RTLD_DI_LINKMAP) {
-               error("Unsupported request %d", req);
-               return -1;
-       }
-       *(struct link_map **)res = dso;
-       return 0;
-}
-
 __attribute__((__visibility__("hidden")))
 void __dl_vseterr(const char *, va_list);