From owner-svn-src-stable-8@FreeBSD.ORG Sat Oct 15 12:05:31 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3F04106566C; Sat, 15 Oct 2011 12:05:31 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 92A688FC0A; Sat, 15 Oct 2011 12:05:31 +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 p9FC5Vrc012539; Sat, 15 Oct 2011 12:05:31 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9FC5VBU012537; Sat, 15 Oct 2011 12:05:31 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201110151205.p9FC5VBU012537@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 15 Oct 2011 12:05:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226383 - stable/8/libexec/rtld-elf/i386 X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 15 Oct 2011 12:05:31 -0000 Author: kib Date: Sat Oct 15 12:05:31 2011 New Revision: 226383 URL: http://svn.freebsd.org/changeset/base/226383 Log: MFC r226156: Handle the R_386_TLS_TPOFF32 relocation. Modified: stable/8/libexec/rtld-elf/i386/reloc.c Directory Properties: stable/8/libexec/rtld-elf/ (props changed) Modified: stable/8/libexec/rtld-elf/i386/reloc.c ============================================================================== --- stable/8/libexec/rtld-elf/i386/reloc.c Sat Oct 15 12:02:55 2011 (r226382) +++ stable/8/libexec/rtld-elf/i386/reloc.c Sat Oct 15 12:05:31 2011 (r226383) @@ -207,9 +207,11 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry break; case R_386_TLS_TPOFF: + case R_386_TLS_TPOFF32: { const Elf_Sym *def; const Obj_Entry *defobj; + Elf_Addr add; def = find_symdef(ELF_R_SYM(rel->r_info), obj, &defobj, false, cache); @@ -231,8 +233,11 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry goto done; } } - - *where += (Elf_Addr) (def->st_value - defobj->tlsoffset); + add = (Elf_Addr) (def->st_value - defobj->tlsoffset); + if (ELF_R_TYPE(rel->r_info) == R_386_TLS_TPOFF) + *where += add; + else + *where -= add; } break;