Path: utzoo!mnetor!uunet!unisoft!mtxinu!ed From: ed@mtxinu.UUCP (Ed Gould) Newsgroups: comp.unix.wizards Subject: Re: Aliasing text and data segments of a process Message-ID: <555@mtxinu.UUCP> Date: 21 Jan 88 16:56:39 GMT References: <202@sdti.UUCP> Reply-To: ed@mtxinu.UUCP (Ed Gould) Organization: mt Xinu, Berkeley Lines: 22 >Is there a way in Unix to create an "alias" between the text and data >segments of a process? More specifically, how does one go about executing a >block of code that was generated in a data segment? It depends on the hardware architecture and on the implementation of the operating system. Some hardware (e.g., some PDP-11 models) allows for a strict separation of instruction ("text") and data spaces. On such a machine, if the OS uses the feature, then (unless the text space is writable, which it typically isn't) you're out of luck. Other machines, like the VAX, do not rigidly separate instruction and data spaces. Even in this class of machinem though, there may be pitfals: If the hardware has separate read and execute permissions on regions of memory, then the same problem arises. If the OS does not supply execute permission for the data segment, then code can't be executed from there. -- Ed Gould mt Xinu, 2560 Ninth St., Berkeley, CA 94710 USA {ucbvax,uunet}!mtxinu!ed +1 415 644 0146 "`She's smart, for a woman, wonder how she got that way'..."