Loading and Executing Object Code at Runtime
Gary Bisaga x4219
gary at neptune.ctc.contel.com
Wed May 22 21:47:06 AEST 1991
In article <1991Feb16.213056.2632 at kithrup.COM>, sef at kithrup.COM (Sean Eric Fagan) writes:
> In article <1991Feb16.163527.25147 at virtech.uucp> cpcahil at 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 at ctc.contel.com)
More information about the Comp.unix.internals
mailing list