Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 1 Jun 2011 11:44:12 -0400
From:      Alexander Kabaev <kabaev@gmail.com>
To:        Marcel Moolenaar <marcel@xcllnt.net>
Cc:        mdf@freebsd.org, Evans <brde@optusnet.com.au>, Bruce@freebsd.org, freebsd-hackers <freebsd-hackers@freebsd.org>
Subject:   Re: sizeof(function pointer)
Message-ID:  <20110601114412.7de0b349@kan.dnsalias.net>
In-Reply-To: <CC5909A8-5A5D-4859-9769-132BF88B559E@xcllnt.net>
References:  <BANLkTimctcBWRrYVLyc-WLgePyCXqaPTGA@mail.gmail.com> <D541877D-0EE5-4EC3-9197-E9F2A7A10AC1@bsdimp.com> <20110531200652.3fd6fcbe@kan.dnsalias.net> <CC5909A8-5A5D-4859-9769-132BF88B559E@xcllnt.net>

next in thread | previous in thread | raw e-mail | index | archive | help

[-- Attachment #1 --]
On Tue, 31 May 2011 21:09:10 -0700
Marcel Moolenaar <marcel@xcllnt.net> wrote:

> 
> On May 31, 2011, at 5:06 PM, Alexander Kabaev wrote:
> >> Usually it is different only on segmented architectures like 16-bit
> >> x86.
> >> 
> > 
> > Not so on ia64, where they have special function descriptor type.
> 
> 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.
> 
> 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.
> 
> FYI,
> 
> -- 
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.
-- 
Alexander Kabaev

[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (FreeBSD)

iD8DBQFN5l5QQ6z1jMm+XZYRAjgVAJ9KOZOAbApte9l7IAQS4DzNqVVsHACfXNfw
mhWAgk2PlN+4EAtGt9wIf0U=
=P2pN
-----END PGP SIGNATURE-----

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110601114412.7de0b349>