From 780cbbe63ad9e60ef30dbcb2d74271e899dae245 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 29 Jun 2013 12:46:46 -0400 Subject: implement minimal dlinfo function --- src/ldso/dlinfo.c | 8 ++++++++ src/ldso/dynlink.c | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/ldso/dlinfo.c (limited to 'src') diff --git a/src/ldso/dlinfo.c b/src/ldso/dlinfo.c new file mode 100644 index 00000000..4748eaf8 --- /dev/null +++ b/src/ldso/dlinfo.c @@ -0,0 +1,8 @@ +#include + +int __dlinfo(void *, int, void *); + +int dlinfo(void *dso, int req, void *res) +{ + return __dlinfo(dso, req, res); +} diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c index ac4b669f..7031d03a 100644 --- a/src/ldso/dynlink.c +++ b/src/ldso/dynlink.c @@ -1273,6 +1273,18 @@ int __dladdr (void *addr, Dl_info *info) } #endif +int __dlinfo(void *dso, int req, void *res) +{ + if (invalid_dso_handle(dso)) return -1; + if (req != RTLD_DI_LINKMAP) { + snprintf(errbuf, sizeof errbuf, "Unsupported request %d", req); + errflag = 1; + return -1; + } + *(struct link_map **)res = dso; + return 0; +} + char *dlerror() { if (!errflag) return 0; -- cgit v1.2.1