From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NhSsv-0000OH-Ca for qemu-devel@nongnu.org; Tue, 16 Feb 2010 14:15:01 -0500 Received: from [199.232.76.173] (port=38208 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NhSst-0000Mz-UT for qemu-devel@nongnu.org; Tue, 16 Feb 2010 14:14:59 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NhSss-0002VB-Hz for qemu-devel@nongnu.org; Tue, 16 Feb 2010 14:14:59 -0500 Received: from [71.162.243.5] (port=59113 helo=grelber.thyrsus.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NhSss-0002Ut-7j for qemu-devel@nongnu.org; Tue, 16 Feb 2010 14:14:58 -0500 From: Rob Landley Subject: Re: [Qemu-devel] qemu-ppc can't run static uClibc binaries. Date: Tue, 16 Feb 2010 13:14:54 -0600 References: <201002110520.07620.rob@landley.net> <201002161231.54740.rob@landley.net> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <201002161314.54716.rob@landley.net> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: riku.voipio@iki.fi, "qemu-devel@nongnu.org Developers" On Tuesday 16 February 2010 12:36:15 Alexander Graf wrote: > On 16.02.2010, at 19:31, Rob Landley wrote: > > Let's see, one of the lines I #ifdefed out (line 535-ish of linux- > > user/elfload.c) is: > > > > get_user_ual(_regs->gpr[3], pos); > > > > Rummage, rummage... get_user_ual() is a wrapper for get_user() which is a > > wrapper for __get_user() which assigns to its first argument. So yeah, > > that's setting _regs->gpr[3] to a nonzero value. > > Well I was wondering on the order of execution. If main() already sets the > GPRs to 0 it should be 0. I assume the elf reading code comes after that? > If so, your patch looks correct. The main() code memsets all the registers to zero when the array is allocated, then passes the register array as the first argument to the target-specific init_thread(), which can initialize them to other values. So yeah, main() calls the elf reading code after the memset. Rob -- Latency is more important than throughput. It's that simple. - Linus Torvalds