public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [Linux-ia64] Newbie questions
@ 2002-11-08 19:01 Matthew Wilcox
  2002-11-08 19:03 ` CH Gowri Kumar
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Matthew Wilcox @ 2002-11-08 19:01 UTC (permalink / raw)
  To: linux-ia64

On Sat, Nov 09, 2002 at 12:21:40AM +0530, CH Gowri Kumar wrote:
> I wrote the above program and compiled it and found the appropriate codes
> for the instructions using objdump -d and wrote the following program
> 
> char sc[] ="\x0a"
>            "\x10"
>            "\x00"
>            "\x18\x00\x21\x00\x92\x00\x00\x42\xe0\x11\x00\x20\x84\x0a";
>        main()
>        {
>          void (*fp)(void);
>          fp = (void*)sc;
>          fp();
>       }
> 
> But this program on execution gives me the error:
> "Illegal instruction (core dumped)"
> (A similar program for IA-32 worked well.)

function pointers on ia64 are "fat" -- that is, they are not the address
of the function, they are the address of a function descriptor which
contains (iirc) the GP and the address of the function.  i believe glibc
pokes around with this kind of thing, so you may wish to look at the
ia64 assembly code in there to see how it does it.

-- 
Revolutions do not require corporate support.


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2002-11-11 18:45 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-08 19:01 [Linux-ia64] Newbie questions Matthew Wilcox
2002-11-08 19:03 ` CH Gowri Kumar
2002-11-08 19:07 ` Stephane Eranian
2002-11-08 19:09 ` David Mosberger
2002-11-11  2:56 ` Saxena, Sunil
2002-11-11 18:45 ` David Mosberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox