#define TV_GETTIME(tv) tv = mono_100ns_ticks ()
#define TV_ELAPSED(start,end) (((end) - (start)) / 10)
-#ifdef TARGET_WIN32
-#define SHARED_EXT ".dll"
-#elif defined(__ppc__) && defined(TARGET_MACH)
-#define SHARED_EXT ".dylib"
-#elif defined(TARGET_MACH) && defined(TARGET_X86) && !defined(__native_client_codegen__)
-#define SHARED_EXT ".dylib"
-#elif defined(TARGET_MACH) && defined(TARGET_AMD64) && !defined(__native_client_codegen__)
-#define SHARED_EXT ".dylib"
-#else
-#define SHARED_EXT ".so"
-#endif
-
#define ALIGN_TO(val,align) ((((guint64)val) + ((align) - 1)) & ~((align) - 1))
#define ALIGN_PTR_TO(ptr,align) (gpointer)((((gssize)(ptr)) + (align - 1)) & (~(align - 1)))
#define ROUND_DOWN(VALUE,SIZE) ((VALUE) & ~((SIZE) - 1))
char *name1, *name2, *cached;
int i, j, len, count;
+ name1 = mono_method_full_name (method, TRUE);
+
#ifdef TARGET_MACH
// This is so that we don't accidentally create a local symbol (which starts with 'L')
- if (!prefix || !*prefix)
+ if ((!prefix || !*prefix) && name1 [0] == 'L')
prefix = "_";
#endif
- name1 = mono_method_full_name (method, TRUE);
len = strlen (name1);
name2 = malloc (strlen (prefix) + len + 16);
memcpy (name2, prefix, strlen (prefix));
encode_value (table->num_holes, p, &p);
}
+ if (jinfo->has_arch_eh_info) {
+ /*
+ * In AOT mode, the code length is calculated from the address of the previous method,
+ * which could include alignment padding, so calculating the start of the epilog as
+ * code_len - epilog_size is correct any more. Save the real code len as a workaround.
+ */
+ encode_value (jinfo->code_size, p, &p);
+ }
+
/* Exception table */
if (cfg->compile_llvm) {
/*
tempbc = g_strdup_printf ("%s.bc", acfg->tmpbasename);
- mono_llvm_emit_aot_module (tempbc, acfg->final_got_size);
+ mono_llvm_emit_aot_module (tempbc, g_path_get_basename (acfg->image->name), acfg->final_got_size);
g_free (tempbc);
/*
if (acfg->aot_opts.outfile)
outfile_name = g_strdup_printf ("%s", acfg->aot_opts.outfile);
else
- outfile_name = g_strdup_printf ("%s%s", acfg->image->name, SHARED_EXT);
+ outfile_name = g_strdup_printf ("%s%s", acfg->image->name, MONO_SOLIB_EXT);
tmp_outfile_name = g_strdup_printf ("%s.tmp", outfile_name);
g_free (command);
- /*com = g_strdup_printf ("strip --strip-unneeded %s%s", acfg->image->name, SHARED_EXT);
+ /*com = g_strdup_printf ("strip --strip-unneeded %s%s", acfg->image->name, MONO_SOLIB_EXT);
printf ("Stripping the binary: %s\n", com);
system (com);
g_free (com);*/
if (acfg->aot_opts.outfile)
outfile_name = g_strdup_printf ("%s", acfg->aot_opts.outfile);
else
- outfile_name = g_strdup_printf ("%s%s", acfg->image->name, SHARED_EXT);
+ outfile_name = g_strdup_printf ("%s%s", acfg->image->name, MONO_SOLIB_EXT);
/*
* Can't use g_file_open_tmp () as it will be deleted at exit, and