#ifdef SHARED
-#include "reloc.h"
-
#if ULONG_MAX == 0xffffffff
typedef Elf32_Ehdr Ehdr;
typedef Elf32_Phdr Phdr;
char buf[];
};
+#include "reloc.h"
+
void __init_ssp(size_t *);
static struct dso *head, *tail, *libc;
static int ssp_used;
static int runtime;
static int ldd_mode;
+static int ldso_fail;
static jmp_buf rtld_fail;
static pthread_rwlock_t lock;
static struct debug debug;
dso->name, name);
if (runtime) longjmp(rtld_fail, 1);
dprintf(2, "%s\n", errbuf);
- _exit(127);
+ ldso_fail = 1;
+ continue;
}
sym_size = sym->st_size;
+ } else {
+ sym_val = sym_size = 0;
}
do_single_reloc(reloc_addr, type, sym_val, sym_size, base, rel[2]);
}
p->strings + p->dynv[i+1], p->name);
if (runtime) longjmp(rtld_fail, 1);
dprintf(2, "%s\n", errbuf);
- _exit(127);
+ ldso_fail = 1;
+ continue;
}
if (runtime) {
tmp = realloc(*deps, sizeof(*tmp)*(ndeps+2));
reloc_all(app->next);
reloc_all(app);
+ if (ldso_fail) _exit(127);
if (ldd_mode) _exit(0);
/* Switch to runtime mode: any further failures in the dynamic
* all memory used by the dynamic linker. */
runtime = 1;
+#ifndef DYNAMIC_IS_RO
for (i=0; app->dynv[i]; i+=2)
if (app->dynv[i]==DT_DEBUG)
app->dynv[i+1] = (size_t)&debug;
+#endif
debug.ver = 1;
debug.bp = _dl_debug_state;
debug.head = head;
if (sym && sym->st_value && (1<<(sym->st_info&0xf) & OK_TYPES))
return p->base + sym->st_value;
if (p->deps) for (i=0; p->deps[i]; i++) {
- sym = lookup(s, h, p);
+ sym = lookup(s, h, p->deps[i]);
if (sym && sym->st_value && (1<<(sym->st_info&0xf) & OK_TYPES))
return p->deps[i]->base + sym->st_value;
}