Skip to content

Commit

Permalink
Prefix exported symbols defined via EntryPoint of UnmanagedCallersOnl…
Browse files Browse the repository at this point in the history
…y attribute with an underscore on Apple platforms
  • Loading branch information
ivanpovazan committed Jan 13, 2023
1 parent b53dfdf commit b996006
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/mono/mono/mini/aot-compiler.c
Original file line number Diff line number Diff line change
Expand Up @@ -5244,9 +5244,9 @@ MONO_RESTORE_WARNING
for (j = 0; j < decoded_args->named_args_num; ++j) {
if (decoded_args->named_args_info [j].field && !strcmp (decoded_args->named_args_info [j].field->name, "EntryPoint")) {
named = (const char *)decoded_args->named_args[j]->value.primitive;
slen = mono_metadata_decode_value (named, &named);
slen = mono_metadata_decode_value (named, &named) + (int)strlen(acfg->user_symbol_prefix);
export_name = (char *)g_malloc (slen + 1);
memcpy (export_name, named, slen);
sprintf (export_name, "%s%s", acfg->user_symbol_prefix, named);
export_name [slen] = 0;
}
}
Expand All @@ -5258,7 +5258,7 @@ MONO_RESTORE_WARNING
add_method (acfg, wrapper);
if (export_name) {
g_hash_table_insert (acfg->export_names, wrapper, export_name);
g_string_append_printf (export_symbols, "%s%s\n", acfg->user_symbol_prefix, export_name);
g_string_append_printf (export_symbols, "%s\n", export_name);
}
}

Expand Down

0 comments on commit b996006

Please sign in to comment.