#define RTLD_NEXT ((void *)-1)
#define RTLD_DEFAULT ((void *)0)
+#define RTLD_DI_LINKMAP 2
+
int dlclose(void *);
char *dlerror(void);
void *dlopen(const char *, int);
void *dli_saddr;
} Dl_info;
int dladdr(void *, Dl_info *);
+int dlinfo(void *, int, void *);
#endif
#ifdef __cplusplus
--- /dev/null
+#include <dlfcn.h>
+
+int __dlinfo(void *, int, void *);
+
+int dlinfo(void *dso, int req, void *res)
+{
+ return __dlinfo(dso, req, res);
+}
}
#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;