This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: is casting of function descriptor assignments for ia64 ONLY a good idea?
- From: law at redhat dot com
- To: Keith Owens <kaos at sgi dot com>
- Cc: Piet/Pete Delaney <piet at sgi dot com>, linux-ia64 at linuxia64 dot org, srn at engr dot sgi dot com, davidm at hpl dot hp dot com, bug-gdb at gnu dot org, bug-gcc at gnu dot org
- Date: Thu, 03 Jan 2002 10:11:20 -0700
- Subject: Re: is casting of function descriptor assignments for ia64 ONLY a good idea?
- Reply-to: law at redhat dot com
> Not just ia64, powerpc 64 as well. You are assuming that all pointers
> are the same format when that is not guaranteed by the C standard. On
> most architectures they are the same, you can convert a function
> pointer to a void pointer and back again but it is not defined
> behaviour.
>
> On IA64 and PPC64 the function pointer does not reference the function
> itself, instead it points to a function descriptor. The function
> descriptor contains a pointer to the function code plus additional data
> such as a pointer to the global data to be used when the function is
> called. This is mandated by the architecture software ABI.
Also true for HPPA targets.
jeff