Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 Aug 2018 16:54:37 +0000 (UTC)
From:      Michal Meloun <mmel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338317 - head/libexec/rtld-elf/arm
Message-ID:  <201808251654.w7PGsbJO022398@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201808251654.w7PGsbJO022398>