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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to