From owner-svn-src-all@FreeBSD.ORG Sat Dec 17 15:31:00 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C2FC51065675; Sat, 17 Dec 2011 15:31:00 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B173E8FC1F; Sat, 17 Dec 2011 15:31:00 +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 pBHFV0UA065070; Sat, 17 Dec 2011 15:31:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pBHFV0sT065067; Sat, 17 Dec 2011 15:31:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201112171531.pBHFV0sT065067@svn.freebsd.org> From: Nathan Whitehorn Date: Sat, 17 Dec 2011 15:31:00 +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: r228635 - head/libexec/rtld-elf/powerpc X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Dec 2011 15:31:00 -0000 Author: nwhitehorn Date: Sat Dec 17 15:31:00 2011 New Revision: 228635 URL: http://svn.freebsd.org/changeset/base/228635 Log: Fix RTLD on PowerPC after r228435. Changing the order of init_pltgot() caused the icache to be invalidated at the wrong time, resulting in an icache full of nonsense in the PLT section. Modified: head/libexec/rtld-elf/powerpc/reloc.c Modified: head/libexec/rtld-elf/powerpc/reloc.c ============================================================================== --- head/libexec/rtld-elf/powerpc/reloc.c Sat Dec 17 15:26:34 2011 (r228634) +++ head/libexec/rtld-elf/powerpc/reloc.c Sat Dec 17 15:31:00 2011 (r228635) @@ -366,7 +366,7 @@ reloc_plt_object(Obj_Entry *obj, const E /* - * The icache will be sync'd in init_pltgot, which is called + * The icache will be sync'd in reloc_plt, which is called * after all the slots have been updated */ @@ -382,6 +382,7 @@ reloc_plt(Obj_Entry *obj) { const Elf_Rela *relalim; const Elf_Rela *rela; + int N = obj->pltrelasize / sizeof(Elf_Rela); if (obj->pltrelasize != 0) { @@ -396,6 +397,13 @@ reloc_plt(Obj_Entry *obj) } } + /* + * Sync the icache for the byte range represented by the + * trampoline routines and call slots. + */ + if (obj->pltgot != NULL) + __syncicache(obj->pltgot, JMPTAB_BASE(N)*4); + return (0); } @@ -595,10 +603,9 @@ init_pltgot(Obj_Entry *obj) pltresolve[4] |= _ppc_la(obj); /* - * Sync the icache for the byte range represented by the - * trampoline routines and call slots. + * The icache will be sync'd in reloc_plt, which is called + * after all the slots have been updated */ - __syncicache(obj->pltgot, JMPTAB_BASE(N)*4); } void