#include <stdlib.h>
#include <stdarg.h>
#include "pthread_impl.h"
+#include "libc.h"
char *dlerror()
{
__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);
return p;
}
-static int invalid_dso_handle(void *h)
+__attribute__((__visibility__("hidden")))
+int __dl_invalid_handle(void *h)
{
struct dso *p;
for (p=head; p; p=p->next) if (h==p) return 0;
return def.dso->funcdescs + (def.sym - def.dso->syms);
return laddr(def.dso, def.sym->st_value);
}
- if (invalid_dso_handle(p))
+ if (__dl_invalid_handle(p))
return 0;
if ((ght = p->ghashtab)) {
gh = gnu_hash(s);
return ret;
}
#else
-static int invalid_dso_handle(void *h)
-{
- error("Invalid library handle %p", (void *)h);
- return 1;
-}
void *dlopen(const char *file, int mode)
{
error("Dynamic loading not supported");
}
#endif
+__attribute__((__visibility__("hidden")))
+int __dl_invalid_handle(void *);
+
int __dlinfo(void *dso, int req, void *res)
{
- if (invalid_dso_handle(dso)) return -1;
+ if (__dl_invalid_handle(dso)) return -1;
if (req != RTLD_DI_LINKMAP) {
error("Unsupported request %d", req);
return -1;
int dlclose(void *p)
{
- return invalid_dso_handle(p);
+ return __dl_invalid_handle(p);
}
__attribute__((__visibility__("hidden")))