[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Test fixes for calling functions on Itanium



At 2002/7/28 12:58-0400  Stuart Anderson writes:
> >   The test program assumes that taking the address of a
> >   function returns the entry-point address of that function.
> >   This is not so on ia64 (and several other arches, including
> >   VAX, PA-RISC, and PPC, I believe). Instead, what you get
> >   on ia64 is a pointer to a function descriptor:
> >
> > 	struct fdesc {
> > 	  void *ip;	/* entry point (code address) */
> > 	  void *gp;	/* global-pointer */
> > 	};
> >
> >
> > The patches as written are totally Itanium-specific
> > and have no effect if not compiling __ia64__.  If this
> > code applies to other architectures, someone else will
> > have to make those additions.
> 
> 
> Isn't the languange and compilation system supposed to hide these kind
> of details better than this?

The behaviour that the test is relying on - being able to take the
address of a function, copy a few pages at that address somewhere else
then be able to execute that copy appears to be outside of defined
behaviour in the C spec.

btw although ppc64 also uses function descriptors the test happens to
pass because on that platform execute permission on an area of memory
implies read permission (which is not true on ia64). Though what ends
up being copied is not the code for the function, but just the
function descriptor.

Chris
-- 
cyeoh@au.ibm.com
IBM OzLabs Linux Development Group
Canberra, Australia


-- 
To UNSUBSCRIBE, email to lsb-test-request@lists.linuxbase.org
with subject of "unsubscribe". Trouble? Email listmaster@lists.linuxbase.org



Reply to: