From: Stephane Eranian <eranian@frankl.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] Newbie questions
Date: Fri, 08 Nov 2002 19:07:12 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590709805371@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590709805370@msgid-missing>
On Fri, Nov 08, 2002 at 07:01:10PM +0000, Matthew Wilcox wrote:
> 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.
>
to be more precise a function descriptors is:
struct {
unsigned long func_addr;
unsigned long gp;
};
You should also take a look at the calling convention documentation
at:
http://developer.intel.com/design/itanium
--
-Stephane
next prev parent reply other threads:[~2002-11-08 19:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2002-11-08 19:09 ` David Mosberger
2002-11-11 2:56 ` Saxena, Sunil
2002-11-11 18:45 ` David Mosberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-ia64-105590709805371@msgid-missing \
--to=eranian@frankl.hpl.hp.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox