delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/03/22/08:08:52

Date: Sun, 22 Mar 1998 16:07:03 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Nate Eldredge <eldredge AT ap DOT net>
cc: Charles Sandmann <sandmann AT clio DOT rice DOT edu>, cssl AT geocities DOT com,
djgpp-workers AT delorie DOT com
Subject: Re: Can the text section be made read-only?
In-Reply-To: <199803220136.RAA16736@adit.ap.net>
Message-ID: <Pine.SUN.3.91.980322160644.12221O-100000@is>
MIME-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019