From: Linus Benedict Torvalds (torvalds@klaava.Helsinki.FI)
Date: 08/21/92


From: torvalds@klaava.Helsinki.FI (Linus Benedict Torvalds)
Subject: Re: shared libs - can everyone be happy with this?
Date: 21 Aug 1992 07:55:38 GMT

In article <TED.92Aug20103404@pylos.nmsu.edu> ted@nmsu.edu writes:
>
>writable code segments or executable data segments are _very_
>important to programs that would like to do dynamic loading.
>
>of these two options, the second is preferable.

Right now, linux accepts both: early versions of linux didn't allow
executable data-segments (the code segment was only as long as indicated
by the executable header), but I changed that as gcc-2 actually assumes
data space is executable (it can build small functions on the stack).
Another reason was actually to get 'crashme' to run: without an
executable data-segment crashme won't run at all (without
modifications). And while it might sound weird to change the kernel to
/help/ crashme, that's what I did. After all, the idea of crashme is to
test whether a system is stable, and if crashme fails for the silly
reason that it cannot execute the code it has just set up, it's not
anything to brag about. The fact that crashme /still/ seems to fail
despite being able to try, is a good thing (tm).

Writable code might go away eventually: there is no longer any good
reason for it now that the standard library should be well-behaved. But
I'm not in any hurry about it: if somebody /wants/ to write
self-modifying code, maybe it should be permissible. I don't dislike
goto's either.

                Linus