From owner-svn-src-head@freebsd.org Thu Dec 19 22:35:17 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 50C4A1ECB16; Thu, 19 Dec 2019 22:35:17 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47f6C91Ry5z4BWg; Thu, 19 Dec 2019 22:35:17 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D0881D6C4; Thu, 19 Dec 2019 22:35:17 +0000 (UTC) (envelope-from bdragon@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBJMZG47085503; Thu, 19 Dec 2019 22:35:16 GMT (envelope-from bdragon@FreeBSD.org) Received: (from bdragon@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBJMZGVo085502; Thu, 19 Dec 2019 22:35:16 GMT (envelope-from bdragon@FreeBSD.org) Message-Id: <201912192235.xBJMZGVo085502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdragon set sender to bdragon@FreeBSD.org using -f From: Brandon Bergren Date: Thu, 19 Dec 2019 22:35:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355917 - head/sys/sys X-SVN-Group: head X-SVN-Commit-Author: bdragon X-SVN-Commit-Paths: head/sys/sys X-SVN-Commit-Revision: 355917 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 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: Thu, 19 Dec 2019 22:35:17 -0000 Author: bdragon Date: Thu Dec 19 22:35:16 2019 New Revision: 355917 URL: https://svnweb.freebsd.org/changeset/base/355917 Log: [PowerPC] Only move linker sets to .data on ELFv1 In r268055, powerpc64 was special cased regarding linker sets to not mark the function pointer as 'const'. This appears to have been done to ensure the compiler generates the function descriptors correctly. When non-const, the function descriptors will end up in the .data.rel.local section, and the linker set symbols will get relocations pointing to them there. Since function pointers on ELFv2 are "just" pointers like other platforms, we can leave them const like they are on every other platform. Reviewed by: jhibbits Differential Revision: https://reviews.freebsd.org/D22796 Modified: head/sys/sys/linker_set.h Modified: head/sys/sys/linker_set.h ============================================================================== --- head/sys/sys/linker_set.h Thu Dec 19 19:34:25 2019 (r355916) +++ head/sys/sys/linker_set.h Thu Dec 19 22:35:16 2019 (r355917) @@ -42,8 +42,11 @@ * For ELF, this is done by constructing a separate segment for each set. */ -#if defined(__powerpc64__) +#if defined(__powerpc64__) && (!defined(_CALL_ELF) || _CALL_ELF == 1) /* + * ELFv1 pointers to functions are actaully pointers to function + * descriptors. + * * Move the symbol pointer from ".text" to ".data" segment, to make * the GCC compiler happy: */