This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Bad code for ia64 with function pointer


>So, it's impossible to do this kind of indirect call with C ?

I don't know what you are trying to accomplish, so I don't know if there
is a valid way to do it.

Your example is trying to contruct a function pointer from a data address.
This is possible.  However, you need machine dependent code, you need a
good understanding of the ABIs used by your targets, and you need to know
which language rules are safe to violate with which compilers, and when
it is safe to violate them.  In practice, you don't want to do this unless
you have a really good reason to do it.  Glibc for instance has code to do
this, but glibc has a good reason for doing this, it is needed for the ELF
startup files.  See for instance DL_AUTO_FUNCTION_ADDRESS in libc/sysdeps/
ia64/dl-lookupcfg.h.

Jim


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]