Path: utzoo!attcan!uunet!mcvax!ukc!eagle!icdoc!tgould!iwm From: iwm@asun3.ic.ac.uk (Ian Moor) Newsgroups: comp.lang.c Subject: Re: Jumping to data Message-ID: Date: 13 Sep 88 09:36:43 GMT References: <5162@hoptoad.uucp> <225800065@uxe.cso.uiuc.edu> Sender: news@doc.ic.ac.uk Organization: Dept. of Computing, Imperial College Lines: 25 Posting-Front-End: GNU Emacs 18.45.3 of Fri Jun 26 1987 on asun3 (berkeley-unix) >>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!)