Mail Archives: djgpp-workers/1998/03/22/08:08:52
On Sat, 21 Mar 1998, Nate Eldredge wrote:
> >But the core issue on all of this is moving the writable variables
> >in exceptn.s out of the text section... there is no way to
> >implement it without doing that first.
>
> Is that as simple as just adding `.data' before them and `.text' after? It
> looks like it is (the code that locks them doesn't seem to care where they
> are), but I'm not sure.
I believe adding .data is not enough. The problem which caused these
variables be inside .text is that when a signal is pending, the DS
selector is invalid (that's how the DJGPP signals are scheduled to run
once the program is back in its foreground execution task). Moving
the variables to .data requires that the interrupt handlers on
exceptn.S first set DS to the correct selector using the DS alias.
Charles, am I right here?
Does the code on exceptn.S need to restore the (invalid) DS before it
exits, so as not to break signals mechanism?
I would also suggest to look through library sources for other modules
that assume these variables are in the CS segment. I'm not sure
exceptn.S is the only one. The startup code and the stub would be the
first places to look.
- Raw text -