From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IfgVj-0006RT-IR for qemu-devel@nongnu.org; Wed, 10 Oct 2007 14:42:23 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IfgVg-0006Pm-RP for qemu-devel@nongnu.org; Wed, 10 Oct 2007 14:42:22 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IfgVg-0006Pj-LX for qemu-devel@nongnu.org; Wed, 10 Oct 2007 14:42:20 -0400 Received: from bangui.magic.fr ([195.154.194.245]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IfgVf-0002XZ-Gh for qemu-devel@nongnu.org; Wed, 10 Oct 2007 14:42:20 -0400 Subject: Re: [Qemu-devel] RFC: fix run of 32 bits Linux executables on 64 bits targets From: "J. Mayer" In-Reply-To: References: <1192002128.9976.186.camel@rapid> Content-Type: text/plain Date: Wed, 10 Oct 2007 20:42:16 +0200 Message-Id: <1192041736.9976.193.camel@rapid> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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: Blue Swirl On Wed, 2007-10-10 at 19:01 +0300, Blue Swirl wrote: > On 10/10/07, J. Mayer wrote: > > Following the patches done for elfload32, it appeared to me that there > > were still problems that would prevent 32 bits executables to run on 64 > > bits target in linux user mode emulation. > > First of all, the personality was never set to PER_LINUX32 > > It's set in elfload32.c, but I think your approach is better. The check for > elf_ex->e_ident[EI_CLASS] == ELFCLASS64 > could be moved from elfload32.c. Well, it is overriden just before the create_elf_table call... And it's especially needed there and in the start_thread code, at least for PowerPC. As the kernel set it up at this point, it seems to be a good idea to do the same ! > > The second problem was that pointers used to set the values on the stack > > were still of target_ulong size, which lead 32 bits executable crash > > dereferencing NULL pointers as soon as they wanted to parse their > > arguments. > > Nice, I was wondering why my test program crashed. I realized there are tons of unneeded checks/code in my patch, as this code is compiled twice. I will repost a cleaned one soon... -- J. Mayer Never organized