|
51 | 51 | #include <mono/metadata/mempool-internals.h> |
52 | 52 | #include <mono/metadata/mono-basic-block.h> |
53 | 53 | #include <mono/metadata/mono-endian.h> |
| 54 | +#include <mono/metadata/native-library.h> |
54 | 55 | #include <mono/metadata/threads-types.h> |
55 | 56 | #include <mono/metadata/custom-attrs-internals.h> |
56 | 57 | #include <mono/utils/mono-logger-internals.h> |
@@ -12407,22 +12408,24 @@ emit_file_info (MonoAotCompile *acfg) |
12407 | 12408 |
|
12408 | 12409 | if (acfg->aot_opts.static_link) { |
12409 | 12410 | char symbol [MAX_SYMBOL_SIZE]; |
12410 | | - char *p; |
12411 | 12411 |
|
12412 | 12412 | /* |
12413 | 12413 | * Emit a global symbol which can be passed by an embedding app to |
12414 | 12414 | * mono_aot_register_module (). The symbol points to a pointer to the file info |
12415 | 12415 | * structure. |
12416 | 12416 | */ |
12417 | 12417 | sprintf (symbol, "%smono_aot_module_%s_info", acfg->user_symbol_prefix, acfg->image->assembly->aname.name); |
12418 | | - |
| 12418 | +#ifdef TARGET_WASM |
| 12419 | + acfg->static_linking_symbol = g_strdup (mono_fixup_symbol_name(symbol)); |
| 12420 | +#else |
12419 | 12421 | /* Get rid of characters which cannot occur in symbols */ |
12420 | | - p = symbol; |
| 12422 | + char *p = symbol; |
12421 | 12423 | for (p = symbol; *p; ++p) { |
12422 | 12424 | if (!(isalnum (*p) || *p == '_')) |
12423 | 12425 | *p = '_'; |
12424 | 12426 | } |
12425 | 12427 | acfg->static_linking_symbol = g_strdup (symbol); |
| 12428 | +#endif |
12426 | 12429 | } |
12427 | 12430 |
|
12428 | 12431 | if (acfg->llvm) |
@@ -14860,7 +14863,6 @@ aot_assembly (MonoAssembly *ass, guint32 jit_opts, MonoAotOptions *aot_options) |
14860 | 14863 | { |
14861 | 14864 | MonoImage *image = ass->image; |
14862 | 14865 | MonoAotCompile *acfg; |
14863 | | - char *p; |
14864 | 14866 | int res; |
14865 | 14867 | TV_DECLARE (atv); |
14866 | 14868 | TV_DECLARE (btv); |
@@ -15120,13 +15122,17 @@ aot_assembly (MonoAssembly *ass, guint32 jit_opts, MonoAotOptions *aot_options) |
15120 | 15122 | acfg->flags = (MonoAotFileFlags)(acfg->flags | MONO_AOT_FILE_FLAG_LLVM_ONLY); |
15121 | 15123 |
|
15122 | 15124 | acfg->assembly_name_sym = g_strdup (get_assembly_prefix (acfg->image)); |
15123 | | - /* Get rid of characters which cannot occur in symbols */ |
| 15125 | +#ifdef TARGET_WASM |
| 15126 | + acfg->global_prefix = g_strdup_printf ("mono_aot_%s", g_strdup(mono_fixup_symbol_name (acfg->assembly_name_sym))); |
| 15127 | +#else |
| 15128 | + char *p; |
| 15129 | + /* Get rid of characters which cannot occur in symbols */ |
15124 | 15130 | for (p = acfg->assembly_name_sym; *p; ++p) { |
15125 | 15131 | if (!(isalnum (*p) || *p == '_')) |
15126 | 15132 | *p = '_'; |
15127 | 15133 | } |
15128 | | - |
15129 | 15134 | acfg->global_prefix = g_strdup_printf ("mono_aot_%s", acfg->assembly_name_sym); |
| 15135 | +#endif |
15130 | 15136 | acfg->plt_symbol = g_strdup_printf ("%s_plt", acfg->global_prefix); |
15131 | 15137 | acfg->got_symbol = g_strdup_printf ("%s_got", acfg->global_prefix); |
15132 | 15138 | if (acfg->llvm) { |
|
0 commit comments