Use the correct value to get the offset of the objects tls data.

Sponsored by:	The FreeBSD Foundation
This commit is contained in:
Andrew Turner 2015-04-15 14:20:12 +00:00
parent 2db317ca85
commit 899b27a318
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=281556

View File

@ -161,7 +161,7 @@ rtld_tlsdesc_handle_locked(struct tls_data *tlsdesc, int flags,
if (def == NULL)
rtld_die();
tlsdesc->index = defobj->tlsindex + def->st_value + rela->r_addend;
tlsdesc->index = defobj->tlsoffset + def->st_value + rela->r_addend;
return (tlsdesc->index);
}
@ -206,7 +206,7 @@ reloc_plt(Obj_Entry *obj)
case R_AARCH64_TLSDESC:
if (ELF_R_SYM(rela->r_info) == 0) {
where[0] = (Elf_Addr)_rtld_tlsdesc;
where[1] = obj->tlsindex + rela->r_addend;
where[1] = obj->tlsoffset + rela->r_addend;
} else {
where[0] = (Elf_Addr)_rtld_tlsdesc_dynamic;
where[1] = (Elf_Addr)reloc_tlsdesc_alloc(obj,