From owner-svn-src-head@freebsd.org Sat Aug 25 16:54:38 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7D02610903D5; Sat, 25 Aug 2018 16:54:38 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 32E477980F; Sat, 25 Aug 2018 16:54:38 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 140B322A25; Sat, 25 Aug 2018 16:54:38 +0000 (UTC) (envelope-from mmel@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w7PGsbPM022399; Sat, 25 Aug 2018 16:54:37 GMT (envelope-from mmel@FreeBSD.org) Received: (from mmel@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w7PGsbJO022398; Sat, 25 Aug 2018 16:54:37 GMT (envelope-from mmel@FreeBSD.org) Message-Id: <201808251654.w7PGsbJO022398@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mmel set sender to mmel@FreeBSD.org using -f From: Michal Meloun Date: Sat, 25 Aug 2018 16:54:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r338317 - head/libexec/rtld-elf/arm X-SVN-Group: head X-SVN-Commit-Author: mmel X-SVN-Commit-Paths: head/libexec/rtld-elf/arm X-SVN-Commit-Revision: 338317 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Aug 2018 16:54:38 -0000 Author: mmel Date: Sat Aug 25 16:54:37 2018 New Revision: 338317 URL: https://svnweb.freebsd.org/changeset/base/338317 Log: Fix wrong offset calculation for R_ARM_TLS_TPOFF32 relocations. TLS_TCB_SIZE is already accounted in defobj-> tlsoffset so all these symbols were incorrectly relocated by +8. Note: The only consumer (for all binaries on my ARM board) of R_ARM_TLS_TPOFF32 relocation is _ThreadRuneLocale variable. And the incorrectly relocated ThreadRuneLocale accidentally pointed to zeroed memory before memory layout change from D16510 had changed status quo. MFC after: 3 weeks Reviewed by: imp, jhb Approved by: re (marius) Modified: head/libexec/rtld-elf/arm/reloc.c Modified: head/libexec/rtld-elf/arm/reloc.c ============================================================================== --- head/libexec/rtld-elf/arm/reloc.c Sat Aug 25 16:14:56 2018 (r338316) +++ head/libexec/rtld-elf/arm/reloc.c Sat Aug 25 16:54:37 2018 (r338317) @@ -324,9 +324,7 @@ reloc_nonplt_object(Obj_Entry *obj, const Elf_Rel *rel if (!defobj->tls_done && allocate_tls_offset(obj)) return -1; - /* XXX: FIXME */ - tmp = (Elf_Addr)def->st_value + defobj->tlsoffset + - TLS_TCB_SIZE; + tmp = (Elf_Addr)def->st_value + defobj->tlsoffset; if (__predict_true(RELOC_ALIGNED_P(where))) *where = tmp; else