Skip to content

Commit

Permalink
Use the correct value to get the offset of the objects tls data.
Browse files Browse the repository at this point in the history
Sponsored by:	The FreeBSD Foundation
  • Loading branch information
zxombie committed Apr 15, 2015
1 parent cd724aa commit 304d407
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libexec/rtld-elf/aarch64/reloc.c
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 304d407

Please sign in to comment.