On Thu, 15 Oct 2020 at 22:02, Norman Feske norman.feske@genode-labs.com wrote:
Since you are using the libc, the cleanest way forward would be the mmap (PROT_EXEC) approach. You are right that (our current version of) mmap does not support the passing of -1 as fd. But passing a valid file descriptor is supposed to work, for example:
int const zero_fd = open("/dev/zero", O_RDWR);
void *ptr = mmap((void *)-1, 1024*512, PROT_EXEC, MAP_ANONYMOUS, zero_fd, 0);
Not related to Genode , but my main issue is that the instruction table *was* a static 2d array.. Hard to change base address of that one! So I have now converted the whole thing to use a pointer , which is allocated using the Genode API. It doesn't work, getting exec faults from ram. But I will get there.
Just one more related question. Can exec fault reported by Genode mean a invalid instruction or is it just that it can't exec it?
Michael