Bug 52535 - Offer workflow to pre-load dynamic AOT libraries so that Assembly.Load(byte[]) can function
Summary: Offer workflow to pre-load dynamic AOT libraries so that Assembly.Load(byte[]...
Alias: None
Product: Runtime
Classification: Mono
Component: General ()
Version: master
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-02-15 19:57 UTC by Chris Hamons
Modified: 2017-04-12 15:09 UTC (History)
4 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 52535 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Chris Hamons 2017-02-15 19:57:35 UTC
In this forum thread:


A XM user would like to use Assembly.Load(byte[]) to load an assembly while still consuming the AOT they generated before.

In theory, they could use mono_aot_register_module before loading the assembly, except for one problem. We do not emit the mono_aot_module_ symbol in dylibs, just static libs.
Comment 1 Zoltan Varga 2017-02-16 05:50:14 UTC
We emit a 'mono_aot_file_info' symbol instead, you can use dlopen()+dlsym() to find it.
Comment 2 Chris Hamons 2017-02-16 14:28:44 UTC
@Zoltan - We tried mono_aot_file_info - See crash here - https://forums.xamarin.com/discussion/comment/253104/#Comment_253104
Comment 3 Zoltan Varga 2017-04-12 15:09:35 UTC
Try aot-ing the image using the 'static' option, i.e.:

mono --aot=static foo.dll