From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DNtxa-0000CE-0d for qemu-devel@nongnu.org; Tue, 19 Apr 2005 10:44:18 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DNtxY-0000Bx-B7 for qemu-devel@nongnu.org; Tue, 19 Apr 2005 10:44:17 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DNtxY-0006Je-6p for qemu-devel@nongnu.org; Tue, 19 Apr 2005 10:44:16 -0400 Received: from [216.99.193.136] (helo=jade.spiritone.com) by monty-python.gnu.org with esmtp (TLS-1.0:DHE_RSA_3DES_EDE_CBC_SHA:24) (Exim 4.34) id 1DNtwi-0004Ff-RP for qemu-devel@nongnu.org; Tue, 19 Apr 2005 10:43:25 -0400 Message-ID: <42651881.9070209@BitWagon.com> Date: Tue, 19 Apr 2005 07:41:05 -0700 From: John Reiser MIME-Version: 1.0 Subject: Re: [Qemu-devel] Possible?: statically converting i386 ELF object files to ARM ELF object files References: <4264CAFD.9050008@gmail.com> <200504191249.33379.paul@codesourcery.com> In-Reply-To: <200504191249.33379.paul@codesourcery.com> Content-Type: text/plain; charset=iso-8859-1; format=flowed 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: Sebastian Nowozin Paul Brook wrote: > On Tuesday 19 April 2005 10:10, Sebastian Nowozin wrote: [snip] >>I have wondered wether the code conversion ability of qemu could be >>utilized to convert ELF .o object files compiled for i386 Linux by GCC >>to .o object files for ARM/Linux. [snip] >>(Half a dozen small object files, clearly named like MD2.o MD5.o SHA1.o, ...). > The short answer is no,it's not possible. [snip] > It would be possible to manually write thunks for a particular interface, but > it's a lot of work, and has to be redone for every interface. The even shorter answer is: Just do it. For this particular library, with 6 to 10 particular _leaf_ (!!) functions (functions that don't call any other functions) whose calling sequence can be guessed, the translation is easy. Once you get to where qemu takes care of the tedious part (register and opcode mapping), the rest (inserting the relocation directives for access to a few static 'const' arrays) is easy. -- John Reiser, jreiser@BitWagon.com