Module Name: src
Committed By: joerg
Date: Tue Jun 16 21:01:30 UTC 2020
Modified Files:
src/libexec/ld.elf_so/arch/aarch64: mdreloc.c
Log Message:
Honor addend for R_AARCH64_TLS_TPREL relocation.
To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.14 src/libexec/ld.elf_so/arch/aarch64/mdreloc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/libexec/ld.elf_so/arch/aarch64/mdreloc.c
diff -u src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.13 src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.14
--- src/libexec/ld.elf_so/arch/aarch64/mdreloc.c:1.13 Fri Jan 18 11:59:03 2019
+++ src/libexec/ld.elf_so/arch/aarch64/mdreloc.c Tue Jun 16 21:01:30 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: mdreloc.c,v 1.13 2019/01/18 11:59:03 skrll Exp $ */
+/* $NetBSD: mdreloc.c,v 1.14 2020/06/16 21:01:30 joerg Exp $ */
/*-
* Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: mdreloc.c,v 1.13 2019/01/18 11:59:03 skrll Exp $");
+__RCSID("$NetBSD: mdreloc.c,v 1.14 2020/06/16 21:01:30 joerg Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -296,8 +296,9 @@ _rtld_relocate_nonplt_objects(Obj_Entry
_rtld_tls_offset_allocate(obj))
return -1;
- *where = (Elf_Addr)def->st_value + defobj->tlsoffset +
- sizeof(struct tls_tcb);
+ *where = (Elf_Addr)(def->st_value + defobj->tlsoffset +
+ rela->r_addend + sizeof(struct tls_tcb));
+
rdbg(("TLS_TPREL %s in %s --> %p in %s",
obj->strtab + obj->symtab[symnum].st_name,
obj->path, (void *)*where, defobj->path));