[Mono-dev] Mixed Mode Assemblies

Alex Corrado alexander.corrado at gmail.com
Sat Jul 9 14:31:55 EDT 2011

On Sat, Jul 9, 2011 at 2:12 PM, Tom Spink <tspink at gmail.com> wrote:
> I agree with you here, Jon, and it sounds like quite an interesting
> exercise. Of course, one of the other interesting things here would be what
> compiler do you use to generate a mixed-mode ELF?  Or, how do you embed IL
> (and associated metadata) into your ELF - what process do you run to create
> this combination ELF?

That would be nice and easy if the linker supported adding arbitrary
sections. Then we'd just need a tool to extract the CLI parts from the
PE file and create a binary blob that could be passed off to the
linker. We would also need a way to generate native stubs that would
load and initialize the mono runtime and a way to expose the managed
API as native entry points. Since the CLI is OO, it would make sense
to expose the managed API in a way that would be consumable from some
native object system, like C++, Obj-C, or GObject.

> Also, not having looked at the Mono PE loader (in depth), I don't know how
> hard it would be to abstract the container format away from reading
> metadata.  And after having glanced at it just now - it doesn't look /too/
> horrendous.

Would this really be necessary? Wouldn't it be cleaner if the
ELF/Mach-o binary just linked with libMono and we exposed a native
entry point that would use the Mono embedding APIs to call the managed
Main method?

This does, indeed sound like quite an interesting exercise.


Alex Corrado

More information about the Mono-devel-list mailing list