From: Paul Brook <paul@codesourcery.com>
To: qemu-devel@nongnu.org
Cc: Sebastian Nowozin <nowozin@gmail.com>
Subject: Re: [Qemu-devel] Possible?: statically converting i386 ELF object files to ARM ELF object files
Date: Tue, 19 Apr 2005 12:49:33 +0100 [thread overview]
Message-ID: <200504191249.33379.paul@codesourcery.com> (raw)
In-Reply-To: <4264CAFD.9050008@gmail.com>
On Tuesday 19 April 2005 10:10, Sebastian Nowozin wrote:
> Hello everybody,
>
> (please quote my email address on a reply to this email, I am not member
> of the list, thanks.)
>
> 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. Is this possible or has something
> been attempted in this direction?
>
> The need for such conversion occurs when porting the Java MIDP to ARM.
> Due to export restrictions, for some cryptography code in the MIDP, only
> linkable object files for i386 are available with the sources. (Half a
> dozen small object files, clearly named like MD2.o MD5.o SHA1.o, ...).
The short answer is no,it's not possible.
In many cases it is possible to statically convert whole binaries from one
arch to annother (http://www.complang.tuwien.ac.at/schani/bintrans/).
However in general it is not possible to convert a single object file/library
then link it with native code. This would require inserting thunks on all the
calls between native and translated code. To do this you need the full API
used by the code. ie. what arguments are passed to each function, and how
these arguments are used. C header files are not sufficient for this purpose
by themselves.
To call non-native functions you need to use something like libffi
(http://sources.redhat.com/libffi/), possibly with descriptions autogenerated
from source annotations.
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.
Paul
next prev parent reply other threads:[~2005-04-19 11:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-19 9:10 [Qemu-devel] Possible?: statically converting i386 ELF object files to ARM ELF object files Sebastian Nowozin
2005-04-19 11:49 ` Paul Brook [this message]
2005-04-19 14:41 ` John Reiser
2005-04-19 15:53 ` Bob Deblier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200504191249.33379.paul@codesourcery.com \
--to=paul@codesourcery.com \
--cc=nowozin@gmail.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).