Re: Executing from a heap-allocated data area

2003-02-26 Thread Jonathan Bartlett
#include mprotect(address, length, PROT_READ|PROT_WRITE|PROT_EXEC); Returns 0 on success. Jon On Wed, 26 Feb 2003, Rakesh Agarwal wrote: > I am generating machine code on-the-fly into a "malloc"ed data area. However, I get > a segmentation fault when I transfer control to the data area. I

Executing from a heap-allocated data area

2003-02-26 Thread Rakesh Agarwal
I am generating machine code on-the-fly into a "malloc"ed data area.  However, I get a segmentation fault when I transfer control to the data area.  I suspect this is caused by the fact that the data area has not been marked "executable".  Is there a Linux API that would allow me to make the