Here's a separate question: Has anyone
implemented a usable
architecture switching de/re-compiler?
(ie, you feed in x86 machine code on one
end, and it outputs
ARM machine code from the other) Theoretically possible,
but
I don't know the specifics well enough to know how
practical.
Probably not that difficult to translate
between
instruction sets, but much more is needed. We might assume
you would
like to translate a program written for one
platform to a form that can run on
another. Suddenly we run
into all kinds of problems above and beyond
translating the
instruction set. We need to "unlink" the code as well, and
relink it in the format expected by the target platform.
This is not a job
done by a compiler, obviously, but rather,
done by a linker if one existed that
can translate link
formats. Finally, supposing we did all that, system and OS
API calls will be different on the two platforms, so the job
is
hopeless.
What might be translatable might be a block of pure code,
with no system calls - in the form of an object file. Then,
we still need to
translate file formats, so that when we
compile the translated object code on
the new platform will
understand it. [ Reply to This | Parent | # ]
|