Path: utzoo!utgpu!water!watmath!clyde!ima!minya!jc From: jc@minya.UUCP (John Chambers) Newsgroups: comp.unix.wizards Subject: Re: Aliasing text and data segments of a process Summary: ya turkey, ya posted a spoiler! Message-ID: <459@minya.UUCP> Date: 28 Jan 88 04:27:04 GMT References: <11476@brl-adm.ARPA> Organization: home Lines: 40 In article <11476@brl-adm.ARPA>, rbj@icst-cmr.arpa (Root Boy Jim) writes: > From: Doug Gwyn > > This cannot possibly work on an architecture that enforces the > > distinction between Instruction and Data spaces. > While true, most such machines do not *insist* on enforcing the distinction, > or provide mechanisms around it where appropriate. Thus is is possible to > build three or four types of executables on a given system: > > [examples deleted] Jeez, what a turkey! Here I was enjoying all the flames I was getting from people telling me what a fool I was thinking that my examples might work on machines with separate I and D spaces, and you had to go post descriptions of how it might be implemented. Now I'm going to have to find some other, much less entertaining stuff to read. At least I have a few good SF books to turn to. BTW, do you recall back in the early days of the obscure-C contest, there was a cute entry that started: short main[] = { followed by a jumbled list of numbers in various formats? It was a program that ran on PDP-11s and VAXen and did something reasonably silly. Anyhow, I tried it out on a PDP-11/75 that I had handy. The machine definitely had separate I and D spaces, and the program quite definitely worked. I didn't tell the compiler anything special, and I doubt the linker recognized that _main was special and belonged in I space. But neither the compiler nor the linker was fazed by having main as a data array. So far, I haven't heard from anyone that has claimed to try either of my posted examples and found them not to work. I was really hoping I'd get responses from people telling me where they failed and how. Well, maybe if I wait long enough, I'll learn something. [I do know personally of one commercial system where breakpoints don't work because I space is unwritable; I won't let on which one, in hopes I'll learn of more.] On to the SF books... -- John Chambers <{adelie,ima,maynard,mit-eddie}!minya!{jc,root}> (617/484-6393)