Jumping to data

Ian Moor iwm at asun3.ic.ac.uk
Tue Sep 13 19:36:43 AEST 1988



>>What's to stop you from doing the following:

>>	Generate code in an array.
>>	Jump to the beginning of the array. *

>IF you can't do this, an entire class of programs
>becomes absolutely impossible: incremental compilers. It would prohibit
>a Turbo C or Quick C clone, for example. All of my programs I have designed
>for teaching chemistry and physics wouldn't work.

There is almost certainly an extended compiler for producing
trusted programs like compilers and protection to stop you setting
execute permission on your files. 
Think of generate executable == setuid root (sort of).

Do your programs actually poke binary opcodes into memory and jump to
them, or do they have structures with pointers to functions ?  I'm
sure that the compiler will allow pointers to functions that it 
knows it has compiled. If you are actually poking code, have you
considered what happens when you have to move to another machine ?
(I am contemplating trying to debug a program with 'asm' statements
scattered through it -- thats bad enough!)
 



More information about the Comp.lang.c mailing list