public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Grant Grundler <grundler@dsl2.external.hp.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] Re: is casting of function descriptor assignments for ia64 ONLY a good idea?
Date: Thu, 03 Jan 2002 17:35:51 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590698805737@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590698805734@msgid-missing>

Piet/Pete Delaney wrote:
> SUMMARY:
> 
> 	Keith Owens just pointed out that ia64 function descriptor assignments 
>   MUST be cast:
> 
> 		 pointer = ((unsigned long *)(&my_printf))[0])
> 
> 	howerver it appears that other platforms MUST NOT be cast.

I'm pretty sure parisc64 (ELF) does something similar.

We had issues with 32<->64 bit syscall wrappers where a 32-bit user space
structure passed to the kernel contained a function pointer.  I thought it
was in either ioctl32.c or sys_wrapper32.c:
	http://cvs.parisc-linux.org/linux/arch/parisc/kernel/

but couldn't find the exact code.
IIRC, a function ptr has 4 elements and the 3rd contains the addr
to the actual code.

> I've used pointers to functions a lot in the past and I don't recall
> ever haveing a problem like this.

IIRC, the compiler/linker deal with this transperently.
It's only done with function pointers (and not other pointer types).
I only remember seeing this as an issue in 32-64 syscall wrapper conversion.

grant


      parent reply	other threads:[~2002-01-03 17:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-03  8:35 [Linux-ia64] Re: is casting of function descriptor assignments for ia64 ONLY a good idea? Keith Owens
2002-01-03 17:11 ` [Linux-ia64] Re: is casting of function descriptor assignments for ia64 ONLY a law
2002-01-03 17:35 ` Grant Grundler [this message]

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-105590698805737@msgid-missing \
    --to=grundler@dsl2.external.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