Exemplo n.º 1
0
caddr_t
_rtld_bind(const Obj_Entry *obj, Elf_Word reloff)
{
    const Elf_Rel *rel = obj->pltrel + reloff;
    Elf_Addr new_value = 0;	/* XXX gcc */

    _rtld_shared_enter();
    int err = _rtld_relocate_plt_object(obj, rel, &new_value);
    if (err)
        _rtld_die();
    _rtld_shared_exit();

    return (caddr_t)new_value;
}
Exemplo n.º 2
0
caddr_t
_rtld_bind(const Obj_Entry *obj, Elf_Word reloff)
{
	const Elf_Rela *rela = (const Elf_Rela *)((const uint8_t *)obj->pltrela + reloff);
	Elf_Addr result;
	int err;

	result = 0;	/* XXX gcc */

	err = _rtld_relocate_plt_object(obj, rela, &result);
	if (err)
		_rtld_die();

	return (caddr_t)result;
}
Exemplo n.º 3
0
caddr_t
_rtld_bind(Elf_Word a0, Elf_Addr a1, Elf_Addr a2, Elf_Addr a3)
{
	Elf_Addr *got = (Elf_Addr *)(a2 - 0x7ff0);
	const Obj_Entry *obj = (Obj_Entry *)(got[1] & GOT1_MASK);
	Elf_Addr new_value = 0;	/* XXX gcc */
	int err;

	_rtld_shared_enter();
	err = _rtld_relocate_plt_object(obj, a0, &new_value);
	if (err)
		_rtld_die();
	_rtld_shared_exit();

	return (caddr_t)new_value;
}
Exemplo n.º 4
0
Arquivo: tls.c Projeto: Hooman3/minix
void *
_rtld_tls_module_allocate(size_t idx)
{
	Obj_Entry *obj;
	uint8_t *p;

	for (obj = _rtld_objlist; obj != NULL; obj = obj->next) {
		if (obj->tlsindex == idx)
			break;
	}
	if (obj == NULL) {
		_rtld_error("Module for TLS index %zu missing", idx);
		_rtld_die();
	}

	p = xmalloc(obj->tlssize);
	memcpy(p, obj->tlsinit, obj->tlsinitsize);
	memset(p + obj->tlsinitsize, 0, obj->tlssize - obj->tlsinitsize);

	return p;
}