#include <pthread.h>
#include <ctype.h>
#include <dlfcn.h>
+#include "pthread_impl.h"
+#include "libc.h"
+#undef libc
static int errflag;
static char errbuf[128];
z = strchr(s, ':');
l = z ? z-s : strlen(s);
snprintf(buf, buf_size, "%.*s/%s", l, s, name);
- if ((fd = open(buf, O_RDONLY))>=0) return fd;
+ if ((fd = open(buf, O_RDONLY|O_CLOEXEC))>=0) return fd;
s += l;
}
}
}
if (strchr(name, '/')) {
pathname = name;
- fd = open(name, O_RDONLY);
+ fd = open(name, O_RDONLY|O_CLOEXEC);
} else {
/* Search for the name to see if it's already loaded */
for (p=head->next; p; p=p->next) {
if (fd < 0 && env_path) fd = path_open(name, env_path, buf, sizeof buf);
if (fd < 0) {
if (!sys_path) {
- FILE *f = fopen(ETC_LDSO_PATH, "r");
+ FILE *f = fopen(ETC_LDSO_PATH, "rbe");
if (f) {
if (getline(&sys_path, (size_t[1]){0}, f) > 0)
sys_path[strlen(sys_path)-1]=0;
debug.state = 0;
_dl_debug_state();
+ /* Stand-in until real TLS support is added to dynamic linker */
+ __libc.tls_size = sizeof(struct pthread) + 4*sizeof(size_t);
if (ssp_used) __init_ssp(auxv);
do_init_fini(tail);
return (void *)aux[AT_ENTRY];
}
+void *__copy_tls(unsigned char *mem, size_t cnt)
+{
+ return mem;
+}
+
void *dlopen(const char *file, int mode)
{
struct dso *volatile p, *orig_tail = tail, *next;
return 1;
}
-void *__dlsym(void *p, const char *s, void *ra)
+void *__dlsym(void *restrict p, const char *restrict s, void *restrict ra)
{
void *res;
pthread_rwlock_rdlock(&lock);
{
return 0;
}
-void *__dlsym(void *p, const char *s, void *ra)
+void *__dlsym(void *restrict p, const char *restrict s, void *restrict ra)
{
return 0;
}