From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FppZP-00062i-I2 for qemu-devel@nongnu.org; Mon, 12 Jun 2006 12:47:19 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FppZN-00062L-0i for qemu-devel@nongnu.org; Mon, 12 Jun 2006 12:47:18 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FppZM-00062D-UH for qemu-devel@nongnu.org; Mon, 12 Jun 2006 12:47:16 -0400 Received: from [65.74.133.4] (helo=mail.codesourcery.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Fppi7-0007EG-Qk for qemu-devel@nongnu.org; Mon, 12 Jun 2006 12:56:20 -0400 From: Paul Brook Subject: Re: [Qemu-devel] qemu qemu-doc.texi Date: Mon, 12 Jun 2006 17:47:12 +0100 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200606121747.13346.paul@codesourcery.com> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Wolfgang Schildbach > Where would I (start to) look for the reasons behind this? Is this > something that needs to be "fixed" on the ARM side (i.e. fix the location > where the ARM code looks for the environment)? Look at the code in load_elf_binary that uses target_mmap to map the loadable segments into memory. The page size I'm referring to below is the target page size (4k for qemu-arm). target_mmap is more-or-less a wrapper around normal mmap that deals with the corner cases and differences in page size when host != target. There are two issues: - mmap requires the file offset be a multiple of the page size. This is relatively easy to fix. If the file data is misaligned create an anonymous mapping and pread the data. - The code assumes the VMA of the segments after roundind to a page boundary do not overlap. ie. a single memory page will contain data from no more than one segment. Fixing this is more complicated and probably involves merging the regions used by sections with "overlapping" pages. Paul