From owner-freebsd-hackers@FreeBSD.ORG Wed Jun 1 15:44:21 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA7A21065675; Wed, 1 Jun 2011 15:44:21 +0000 (UTC) (envelope-from kabaev@gmail.com) Received: from mail-vw0-f54.google.com (mail-vw0-f54.google.com [209.85.212.54]) by mx1.freebsd.org (Postfix) with ESMTP id 61BA28FC15; Wed, 1 Jun 2011 15:44:20 +0000 (UTC) Received: by vws18 with SMTP id 18so5845388vws.13 for ; Wed, 01 Jun 2011 08:44:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:date:from:to:cc:subject:message-id:in-reply-to :references:x-mailer:mime-version:content-type; bh=5nVeVFvspanfsWAz2UbnT9NqGBrQWKv7ThRh5+PgAg0=; b=DfwQFbE+kajh4PIidO9LrIPEf02pK8VRNFjLcKlgbb5WvW23k5sK5RfMTL7NvgHthm J4h+Rzol/RlTTXBxbDOQfzIRTLZFb/6+LQgFouybEFebXgiKONbTLcNBgnGCMAM7k42q 7ptlh/g78KuhoumUq+AJMEtDBE8FHCpGuIlIc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:x-mailer :mime-version:content-type; b=d4W4Q+7F9y7+l4Ls/XE1MjXJ2Zb4gePvK8ExA99N70+ZPvInFn67ndLHqWdNxKeeDL BRiTLYk4z4c66G7fFj8wU+qmw6x5ggysCJhj1LrWCDnW+B3p31rm46qpVOjld8P5Ba6R bSKbz2YkD9HEhJHym7X6ZTg1MTxUXVJY5aMWA= Received: by 10.52.98.97 with SMTP id eh1mr1350981vdb.7.1306943060285; Wed, 01 Jun 2011 08:44:20 -0700 (PDT) Received: from kan.dnsalias.net (c-24-63-226-98.hsd1.ma.comcast.net [24.63.226.98]) by mx.google.com with ESMTPS id gi16sm182932vcb.25.2011.06.01.08.44.18 (version=SSLv3 cipher=OTHER); Wed, 01 Jun 2011 08:44:19 -0700 (PDT) Date: Wed, 1 Jun 2011 11:44:12 -0400 From: Alexander Kabaev To: Marcel Moolenaar Message-ID: <20110601114412.7de0b349@kan.dnsalias.net> In-Reply-To: References: <20110531200652.3fd6fcbe@kan.dnsalias.net> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/X=ZUaLTmp5J0v+TFtfK7Erg"; protocol="application/pgp-signature" Cc: mdf@freebsd.org, Evans , Bruce@freebsd.org, freebsd-hackers Subject: Re: sizeof(function pointer) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2011 15:44:21 -0000 --Sig_/X=ZUaLTmp5J0v+TFtfK7Erg Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Tue, 31 May 2011 21:09:10 -0700 Marcel Moolenaar wrote: >=20 > On May 31, 2011, at 5:06 PM, Alexander Kabaev wrote: > >> Usually it is different only on segmented architectures like 16-bit > >> x86. > >>=20 > >=20 > > Not so on ia64, where they have special function descriptor type. >=20 > Actually, no. On ia64 a function pointer has the same size as a > data pointer. It's just that a function pointer does not point > to the actual function (i.e. the first instruction of a function), > but to a function descriptor. The function descriptor contains the > address of the actual function and the value of the GP register > that needs to be set before entering the function. >=20 > As such, only virtual functions in C++ are impacted by this. The > function descriptor needs to be stored in the object instead of > the function pointer in that case. >=20 > FYI, >=20 > --=20 Oh, you are correct. I forgot the double indirection we do to support that in dlsym, where we are maintain our own 'virtual table' of function descriptors within rtld itself. --=20 Alexander Kabaev --Sig_/X=ZUaLTmp5J0v+TFtfK7Erg Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.17 (FreeBSD) iD8DBQFN5l5QQ6z1jMm+XZYRAjgVAJ9KOZOAbApte9l7IAQS4DzNqVVsHACfXNfw mhWAgk2PlN+4EAtGt9wIf0U= =P2pN -----END PGP SIGNATURE----- --Sig_/X=ZUaLTmp5J0v+TFtfK7Erg--