From mboxrd@z Thu Jan 1 00:00:00 1970 To: 9fans@cse.psu.edu Date: Fri, 22 Feb 2008 10:02:06 +0000 From: "Douglas A. Gwyn" Message-ID: <47BDE899.33F5E433@null.net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit References: <775b8d190802172323g6c00e380qab1af743c8e240e8@mail.gmail.com>, <2B1882B4-AF7E-4C1C-ADC5-56D56D23F701@kix.in> Subject: Re: [9fans] Non-stack-based calling conventions Topicbox-Message-UUID: 5eb85044-ead3-11e9-9d60-3106f5b1d025 Anant Narayanan wrote: > Just as an observation (may not be related to the thread), all the > executable file formats that Linux currently supports, have page- > aligned sections in the file! ... > That means, all the loader really does is mmap the sections into the > right memory locations. What next, maybe also put in the BSS in the > file so you wouldn't have to allocate that either ;) Ssh, somebody may hear you and decide to do it. Conceptually it's not a bad idea, in environments where you can spare the wasted space. As I recall, using the VM system to map files in Unix goes back to 4BSD; we used to page-align buffer addresses in order to get the kernel to perform faster data transfers. > Hence, writing the loader for Plan 9's a.out proved to be a challenge. > I ended up writing a user-space program that padded out the required > gap between TEXT and DATA before asking the kernel to execute it. > Suboptimal, but it works. > If anyone has any ideas as to how I can improve the situation, i'll be > grateful. I don't understand what good it does to map Plan 9 object code into Linux files. Is there a Linux filetype for Plan 9 that invokes a system-call interpreter, or what?