From mboxrd@z Thu Jan 1 00:00:00 1970 Message-Id: <2B1882B4-AF7E-4C1C-ADC5-56D56D23F701@kix.in> From: Anant Narayanan To: Fans of the OS Plan 9 from Bell Labs <9fans@cse.psu.edu> In-Reply-To: <775b8d190802172323g6c00e380qab1af743c8e240e8@mail.gmail.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Subject: Re: [9fans] Non-stack-based calling conventions Date: Mon, 18 Feb 2008 14:08:02 +0530 References: <5d375e920802171343p323a2708m9f193ae24d2c14e5@mail.gmail.com> <254278ff3375ec25d8a5db25a0d94270@quanstro.net> <775b8d190802171754k725b9696pdd7692590eaf731f@mail.gmail.com> <47B92440.9030609@gmail.com> <775b8d190802172323g6c00e380qab1af743c8e240e8@mail.gmail.com> Topicbox-Message-UUID: 588cf828-ead3-11e9-9d60-3106f5b1d025 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! (Now I know why hexdump always shows me a bunch of zeros in-between). 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 ;) 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. Thanks, Anant