Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/libexec/ld.elf_so Pull up following revision(s) (requeste...



details:   https://anonhg.NetBSD.org/src/rev/9b487fb21d00
branches:  netbsd-8
changeset: 324927:9b487fb21d00
user:      snj <snj%NetBSD.org@localhost>
date:      Thu Jul 26 23:45:09 2018 +0000

description:
Pull up following revision(s) (requested by joerg in ticket #940):
        libexec/ld.elf_so/headers.c: revision 1.64
Apply relocbase for tlsinit of the executable itself. Fixes PIE where
relocbase typically is not zero.
PR bin/53465

diffstat:

 libexec/ld.elf_so/headers.c |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (28 lines):

diff -r 28612db603f8 -r 9b487fb21d00 libexec/ld.elf_so/headers.c
--- a/libexec/ld.elf_so/headers.c       Thu Jul 26 23:43:31 2018 +0000
+++ b/libexec/ld.elf_so/headers.c       Thu Jul 26 23:45:09 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: headers.c,v 1.61.8.1 2017/06/30 06:28:54 snj Exp $      */
+/*     $NetBSD: headers.c,v 1.61.8.2 2018/07/26 23:45:09 snj Exp $      */
 
 /*
  * Copyright 1996 John D. Polstra.
@@ -40,7 +40,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: headers.c,v 1.61.8.1 2017/06/30 06:28:54 snj Exp $");
+__RCSID("$NetBSD: headers.c,v 1.61.8.2 2018/07/26 23:45:09 snj Exp $");
 #endif /* not lint */
 
 #include <err.h>
@@ -449,7 +449,8 @@
                        obj->tlssize = ph->p_memsz;
                        obj->tlsalign = ph->p_align;
                        obj->tlsinitsize = ph->p_filesz;
-                       obj->tlsinit = (void *)(uintptr_t)ph->p_vaddr;
+                       obj->tlsinit = (void *)(obj->relocbase +
+                           (uintptr_t)ph->p_vaddr);
                        dbg(("headers: %s %p phsize %" PRImemsz,
                            "PT_TLS", (void *)(uintptr_t)vaddr,
                             ph->p_memsz));



Home | Main Index | Thread Index | Old Index