views:

247

answers:

3

Is it possible to run the COFF executable files on UNIX or the ELF executable files on Windows? And what would be the steps to be able to run either file type on Windows and UNIX. I'm just curious.

A: 

COFF was originally introduced by UNIX (around System V or thereabouts) so yes, some UNIX probably still supports COFF format. It's been deprecated by Linux at least for a while, and presumably most other Unices have also deprecated or outright dropped support.

Windows ELF support is a bit more iffy - almost certainly not there without some deep trickery. You should be more specific about what you're trying to do here...

Steven Schlansker
http://sf.net/projects/line/ did manage to load ELF executables on Windows -- that may be a good starting point for somebody motivated.
ephemient
A: 

Subsystem for UNIX-based Applications Overview

http://en.wikipedia.org/wiki/Microsoft_Windows_Services_for_UNIX

abmv
SFA/SUA only runs PE executables compiled for NT.
ephemient
+2  A: 

To actually run executables and have them do useful stuff, you need to worry about the API, not just the executable file format. On a Linux machine with WINE installed, you can run Windows .EXE files from the command line and they do the same thing that they do on Windows.

The other way around is not really possible, however if you install CYGWIN on a Windows machine, and then rebuild the application from source with CYGWIN compilers, you will get an executable that runs on Windows and does the same thing that the Linux executable does on Linux. Lots of standard Linux tools are already ported and in the CYGWIN repository including stuff like X-Windows and GIMP.

Michael Dillon
As I commented on in another answer, http://sf.net/projects/line/ attempted to be the inverse of WINE, running unmodified Linux binaries on Windows. The project has been abandoned for years now, but it definitely shows that the concept is possible. If I recall correctly, it could run a few statically-linked console programs, and IPC was in the works.
ephemient