Sym *sym = p->syms + j;
rel[0] = (unsigned char *)got - base;
for (i-=j; i; i--, sym++, rel[0]+=sizeof(size_t)) {
- rel[1] = sym-p->syms << 8 | R_MIPS_JUMP_SLOT;
+ rel[1] = R_INFO(sym-p->syms, R_MIPS_JUMP_SLOT);
do_relocs(p, rel, sizeof rel, 2);
}
}
}
}
if (app.tls.size) {
- libc.tls_head = &app.tls;
+ libc.tls_head = tls_tail = &app.tls;
app.tls_id = tls_cnt = 1;
#ifdef TLS_ABOVE_TP
app.tls.offset = 0;
load_deps(&app);
make_global(&app);
-#ifndef DYNAMIC_IS_RO
- for (i=0; app.dynv[i]; i+=2)
- if (app.dynv[i]==DT_DEBUG)
+ for (i=0; app.dynv[i]; i+=2) {
+ if (!DT_DEBUG_INDIRECT && app.dynv[i]==DT_DEBUG)
app.dynv[i+1] = (size_t)&debug;
-#endif
+ if (DT_DEBUG_INDIRECT && app.dynv[i]==DT_DEBUG_INDIRECT) {
+ size_t *ptr = (size_t *) app.dynv[i+1];
+ *ptr = (size_t)&debug;
+ }
+ }
/* The main program must be relocated LAST since it may contin
* copy relocations which depend on libraries' relocations. */