From owner-svn-src-head@FreeBSD.ORG Tue Mar 6 03:27:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE656106564A; Tue, 6 Mar 2012 03:27:09 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 808AF8FC15; Tue, 6 Mar 2012 03:27:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q263R9dR017452; Tue, 6 Mar 2012 03:27:09 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q263R9HD017449; Tue, 6 Mar 2012 03:27:09 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201203060327.q263R9HD017449@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Tue, 6 Mar 2012 03:27:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r232578 - head/libexec/rtld-elf/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 06 Mar 2012 03:27:09 -0000 Author: gonzo Date: Tue Mar 6 03:27:08 2012 New Revision: 232578 URL: http://svn.freebsd.org/changeset/base/232578 Log: - Switch to saving non-offseted pointer to TLS block in order too keep things simple Modified: head/libexec/rtld-elf/mips/reloc.c head/libexec/rtld-elf/mips/rtld_machdep.h Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Tue Mar 6 03:25:50 2012 (r232577) +++ head/libexec/rtld-elf/mips/reloc.c Tue Mar 6 03:27:08 2012 (r232578) @@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "debug.h" #include "rtld.h" @@ -622,8 +623,7 @@ allocate_initial_tls(Obj_Entry *objs) */ tls_static_space = tls_last_offset + tls_last_size + RTLD_STATIC_TLS_EXTRA; - tls = ((char *) allocate_tls(objs, NULL, TLS_TCB_SIZE, 8) - + TLS_TP_OFFSET + TLS_TCB_SIZE); + tls = (char *) allocate_tls(objs, NULL, TLS_TCB_SIZE, 8); sysarch(MIPS_SET_TLS, tls); } @@ -636,8 +636,7 @@ __tls_get_addr(tls_index* ti) sysarch(MIPS_GET_TLS, &tls); - p = tls_get_addr_common((Elf_Addr**)((Elf_Addr)tls - TLS_TP_OFFSET - - TLS_TCB_SIZE), ti->ti_module, ti->ti_offset + TLS_DTP_OFFSET); + p = tls_get_addr_common(tls, ti->ti_module, ti->ti_offset + TLS_DTP_OFFSET); return (p); } Modified: head/libexec/rtld-elf/mips/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/mips/rtld_machdep.h Tue Mar 6 03:25:50 2012 (r232577) +++ head/libexec/rtld-elf/mips/rtld_machdep.h Tue Mar 6 03:27:08 2012 (r232578) @@ -31,6 +31,7 @@ #include #include +#include struct Struct_Obj_Entry; @@ -48,19 +49,6 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, #define call_initfini_pointer(obj, target) \ (((InitFunc)(target))()) -/* - * TLS - */ - -#define TLS_TP_OFFSET 0x7000 -#define TLS_DTP_OFFSET 0x8000 - -#ifdef __mips_n64 -#define TLS_TCB_SIZE 16 -#else -#define TLS_TCB_SIZE 8 -#endif - typedef struct { unsigned long ti_module; unsigned long ti_offset;