From owner-freebsd-toolchain@FreeBSD.ORG Mon Dec 12 11:19:05 2011 Return-Path: Delivered-To: toolchain@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C4B61065673 for ; Mon, 12 Dec 2011 11:19:05 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 1936E8FC13 for ; Mon, 12 Dec 2011 11:19:04 +0000 (UTC) Received: from alf.home (alf.kiev.zoral.com.ua [10.1.1.177]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id pBCB8QcG000229 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 12 Dec 2011 13:08:26 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from alf.home (kostik@localhost [127.0.0.1]) by alf.home (8.14.5/8.14.5) with ESMTP id pBCB8QCn034495; Mon, 12 Dec 2011 13:08:26 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by alf.home (8.14.5/8.14.5/Submit) id pBCB8Qd3034494; Mon, 12 Dec 2011 13:08:26 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: alf.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 12 Dec 2011 13:08:26 +0200 From: Kostik Belousov To: toolchain@freebsd.org Message-ID: <20111212110826.GM50300@deviant.kiev.zoral.com.ua> References: <201112121103.pBCB3FuT097580@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="FYQbxHc1c8B/Anrp" Content-Disposition: inline In-Reply-To: <201112121103.pBCB3FuT097580@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r228435 - in head/libexec/rtld-elf: . amd64 arm i386 ia64 mips powerpc powerpc64 sparc64 X-BeenThere: freebsd-toolchain@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Maintenance of FreeBSD's integrated toolchain List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Dec 2011 11:19:05 -0000 --FYQbxHc1c8B/Anrp Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Dec 12, 2011 at 11:03:15AM +0000, Konstantin Belousov wrote: > Author: kib > Date: Mon Dec 12 11:03:14 2011 > New Revision: 228435 > URL: http://svn.freebsd.org/changeset/base/228435 >=20 > Log: > Add support for STT_GNU_IFUNC and R_MACHINE_IRELATIVE GNU extensions to > rtld on 386 and amd64. This adds runtime bits neccessary for the use > of the dispatch functions from the dynamically-linked executables and > shared libraries. > =20 > To allow use of external references from the dispatch function, resolut= ion > of the R_MACHINE_IRESOLVE relocations in PLT is postponed until GOT ent= ries > for PLT are prepared, and normal resolution of the GOT entries is finis= hed. > Similar to how it is done by GNU, IRELATIVE relocations are resolved in > advance, instead of normal lazy handling for PLT. > =20 > Move the init_pltgot() call before the relocations for the object are > processed. > =20 > MFC after: 3 weeks An example use of the facilities is provided at http://vger.kernel.org/~davem/cgi-bin/blog.cgi/2010/02/07 Inner working is described by http://www.airs.com/blog/archives/403 To use this feature on FreeBSD, you need patched gas from recent binutils. Patch is available at http://people.freebsd.org/~kib/misc/gas_ifunc_freebsd.1.patch. The 4.6 gcc should be configured with --enable-gnu-indirect-function option to turn on the 'ifunc' function attributes, no patch for compiler is required. Only dynamically linked executables and shared objects are supported, support for static binaries requires changes for csu. Since in-tree toolchain cannot handle dispatch, and I am only interested in the dynamic linking case, I did not modified csu. If we ever need dispatch for system libraries (cases like CPU-optimized string functions, or math) and have a capable toolchain, I promise to add support for static binaries. I handled just x86oids. If maintainer of missed architecture wants to implement dispatch, I am willing to help (as usual). Does anybody on toolchain@ know how to submit the gas change to maintainers for inclusion into mainline, or better, can submit it himself ? I assume that no copyright assignment is required for this trivial flip of settings. --FYQbxHc1c8B/Anrp Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk7l4KkACgkQC3+MBN1Mb4guPACgw8rUbLaX0VIlDbgKQcrP97Hw sZUAoOckniL1/o/Q7XMsuI3hs5Vbqqcv =eV03 -----END PGP SIGNATURE----- --FYQbxHc1c8B/Anrp--