+#ifdef SHARED
#define _GNU_SOURCE
#include <stdio.h>
#include <stdlib.h>
static void error(const char *, ...);
-#ifdef SHARED
-
#define MAXP2(a,b) (-(-(a)&-(b)))
#define ALIGN(x,y) ((x)+(y)-1 & -(y))
}
return ret;
}
-#else
-void *dlopen(const char *file, int mode)
-{
- error("Dynamic loading not supported");
- return 0;
-}
-void *__dlsym(void *restrict p, const char *restrict s, void *restrict ra)
-{
- error("Symbol not found: %s", s);
- return 0;
-}
-#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);
{
va_list ap;
va_start(ap, fmt);
-#ifdef SHARED
if (!runtime) {
vdprintf(2, fmt, ap);
dprintf(2, "\n");
va_end(ap);
return;
}
-#endif
__dl_vseterr(fmt, ap);
va_end(ap);
}
+#endif