Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!pasteur!ucbvax!TAURUS.BITNET!leonid From: leonid@TAURUS.BITNET Newsgroups: comp.arch Subject: Re: self-modifying code Message-ID: <670@taurus.BITNET> Date: 3 Mar 88 15:21:45 GMT References: <486@taux01.UUCP> <902@athos.rutgers.edu> Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: virgo!leonid (Leonid Rosenboim) Organization: Tel-Aviv Univesity Math and CS school, Israel Lines: 13 May I add to this discussion that on most UNIX system with Virtual Memory (e.g. BSD 4.2/3) there is alot of self-modifying code. Except for the debugger case, the idea is implemented by copying some code onto the stack, modifying it there and executing. Some examples I can think of are signal handling, Floating-Point hardware dependent code on SUN. Since dynamic loading is not yet impelemented on BSD systems I dont really know how they're gonna do it. In a word, VM UNIX systems tend to keep the text segment readonly for the sace of text sharing, swap space saving etc, with the few exceptions where that stack segment is used to keep temporary copies of executable code that must be modified. Debugging is an exception. Leonid