No subject

Fri Feb 8 08:55:55 EST 2008

from the executable file."

It also makes not that this is the same trick VB prior to .NET generates
executables and handles it runtime.

In any event, to support it wholesale would be quite a task since not all
Unix environments are ELF supported or x86.  I am a little interested in
"native to native" though.  If you are building assemblies and executibles
on Linux for running on Linux there should be a way to take a shortcut
just like this.  Make the ELF header execute the mono IL interpeter using
itself as data.  It sure won't be portable non-ELF systems and I'm iffy on
whether or not it will work on non-x86 ELF systems.

I'm not saying to make this a mainline feature in the mcs compiler but
possible slate it in as an advance platform specific feature for future

Tom Larsen

On Fri, 18 Jun 2004, Jonathan Pryor wrote:

> On Thu, 2004-06-17 at 18:20, Tom Larsen wrote:
> > Don't quote me on this since I'm not a PE format guru but I believe
> > at least on Windows .Net executibles pull a small feature to fake out
> > the execution environment.  When you run or double click on a .Net built
> > exe file, the system loads the binary where the PE header tells the system
> > to load a publicly exported "start" function found in mscoree.dll and
> > from there on out, this is responsible for IL execution.  The binary
> > executible basically does a "redirect" to the IL interpter so the OS
> > can't tell the difference and handles these binaries like old Win32
> > bins.
> It should be noted that this occurs only for pre-Windows XP systems.
> Windows XP doesn't depend on this feature, and has a system similar to
> binfmt_misc on Linux to launch .NET programs.
> > So here is the big money question: Can the mono runtime do this?
> No.  Mono could do this, but only for Windows systems.  Since Unix-like
> systems are the primary target for Mono, it is unlikely this will be
> done unless it's contributed.
> Why would this work only for Windows?  File format differences.  .NET
> programs use the Portable Executable (PE) format, which (conveniently)
> is the same format used by all Windows executables.  Thus the normal OS
> loader can be used, allowing the seamless integration.
> Linux, and most other Unixes, uses ELF.  Mac OS X uses Mach-O.  Neither
> of which are similar enough to PE for the normal OS loader to think that
> a PE program should be passed to the normal boot loader... ;-)
> Consequently, the same trick can't work off Windows, though it would
> work for any OS that uses PE as the native program format, such as
> ReactOS.
> Linux doesn't need the same trick anyway; binfmt_misc can be used for
> seamless integration, though the Wine/Mono conflict can be annoying and
> needs a proper solution.  I would assume other Unixes have similar
> features.
>  - Jon

More information about the Mono-devel-list mailing list