Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!mahendo!wlbr!europa.asd.contel.com!gary From: gary@neptune.ctc.contel.com (Gary Bisaga x4219) Newsgroups: comp.unix.internals Subject: Re: Loading and Executing Object Code at Runtime Message-ID: <1991May22.074706@neptune.ctc.contel.com> Date: 22 May 91 11:47:06 GMT References: <6073@auspex.auspex.com> <1991Feb16.100946.601@kithrup.COM> <1991Feb16.163527.25147@virtech.uucp> <1991Feb16.213056.2632@kithrup.COM> Sender: news@europa.asd.contel.com (News) Reply-To: gary@ctc.contel.com Organization: Contel Technology Center (until the GTE debacle) Lines: 20 Nntp-Posting-Host: neptune.ctc.contel.com In article <1991Feb16.213056.2632@kithrup.COM>, sef@kithrup.COM (Sean Eric Fagan) writes: > In article <1991Feb16.163527.25147@virtech.uucp> cpcahil@virtech.uucp (Conor P. Cahill) writes: > > (*funcp)(test); > > This is, if you will pardon the hand waving, "different." This is an idiom > the compiler knows about, and it spits out the correct code. Specifically, > it spits out code that uses cs, not ds. On the '386, not matter how hard > you try, you cannot execute something in a writable segment! The execute > bit and the writable bit are mutually exclusive (and if I had my '386 book > here, I'd remember why; I think they are the same bit or something weird > like that). *However*: you *can* alias two or more segments, and use > segment prefixes. But unless you've done that, you cannot execute out of > your data space. You cannot execute a writable segment because there is one bit that means either (a) readable, or (b) writable, depending on whether the segment is executable or not, respectively, which is decided by another bit. And of course, you're right, aliasing is the way this type of thing is normally done. Gary Bisaga (gary@ctc.contel.com)