From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DYREa-0000I1-5S for qemu-devel@nongnu.org; Wed, 18 May 2005 12:17:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DYREU-0000EW-Ol for qemu-devel@nongnu.org; Wed, 18 May 2005 12:17:18 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DYREU-0008Mz-DM for qemu-devel@nongnu.org; Wed, 18 May 2005 12:17:18 -0400 Received: from [65.74.133.9] (helo=mail.codesourcery.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1DYR83-0002dd-V1 for qemu-devel@nongnu.org; Wed, 18 May 2005 12:10:40 -0400 From: Paul Brook Subject: Re: [Qemu-devel] [patch] gcc4 host support Date: Wed, 18 May 2005 17:02:18 +0100 References: <200505112204.10204.paul@codesourcery.com> <200505172146.31089.paul@codesourcery.com> <20050518100634.GC30476@MAIL.13thfloor.at> In-Reply-To: <20050518100634.GC30476@MAIL.13thfloor.at> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200505181702.18555.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: David Woodhouse On Wednesday 18 May 2005 11:06, Herbert Poetzl wrote: > On Tue, May 17, 2005 at 09:46:30PM +0100, Paul Brook wrote: > > On Monday 16 May 2005 10:41, David Woodhouse wrote: > > > On Wed, 2005-05-11 at 22:04 +0100, Paul Brook wrote: > > > > My solution is to search the function for the "ret" instruction and > > > > replace them with a jmp to the next block of code. On RISC targets > > > > this would be easy. > > > > > > About this easy, in fact... > > >... > > > + > > > + if (get32((uint32_t *)p) == 0x4e800020) { > > > + blr_addr = p; > > > + copy_size = p_end - p_start; > > > + break; > > > + } > > > > You probably want to scan the whole function to check there aren't > > multiple blr instructions, and throw an error if there are. > > hmm, wouldn't it be much easier to separate compiling > from assembling, and do the 'changes' on the assembler > files instead? For x86 maybe. For ppc it's easier to just scan the binary code. You'd have to write an assembly code parser. Paul