delorie.com/archives/browse.cgi | search |
From: | mcneils AT applique DOT sedd DOT trw DOT com (Sean McNeil) |
Subject: | Re: A question about writing dynamically in the text segment |
10 Dec 1996 10:20:20 -0800 : | |
Sender: | daemon AT cygnus DOT com |
Approved: | cygnus DOT gnu-win32 AT cygnus DOT com |
Distribution: | cygnus |
Message-ID: | <199612101723.JAA12236.cygnus.gnu-win32@app006221.sedd.trw.com> |
Original-To: | morteza AT eleceng DOT adelaide DOT edu DOT au |
Original-Cc: | gnu-win32 AT cygnus DOT com |
In-Reply-To: | <199612100622.QAA01235@hybrid.eleceng.adelaide.edu.au> |
(morteza AT eleceng DOT adelaide DOT edu DOT au) | |
Original-Sender: | owner-gnu-win32 AT cygnus DOT com |
I don't understand why you "need" to write to the text segment. Why can't you write to the data segment and execute from there? This is an extremely bad programming practice (self-modifying code) and is why text segments try to be read-only. There are all kinds of problems with newer CPUs and invalidating instruction cache or other things like that. Even if you do modify the code, it may not work because of this. - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |