+#ifdef TARGET_WIN32
+#define GLOBAL_SYMBOL_DEF_SCL 2
+#define LOCAL_SYMBOL_DEF_SCL 3
+
+static gboolean
+asm_writer_in_data_section (MonoImageWriter *acfg)
+{
+ gboolean in_data_section = FALSE;
+ const char *data_sections [] = {".data", ".bss", ".rdata"};
+
+ for (guchar i = 0; i < G_N_ELEMENTS (data_sections); ++i) {
+ if (strcmp (acfg->current_section, data_sections [i]) == 0) {
+ in_data_section = TRUE;
+ break;
+ }
+ }
+
+ return in_data_section;
+}
+
+static void
+asm_writer_emit_symbol_type (MonoImageWriter *acfg, const char *name, gboolean func, gboolean global)
+{
+ asm_writer_emit_unset_mode (acfg);
+
+ if (func) {
+ fprintf (acfg->fp, "\t.def %s; .scl %d; .type 32; .endef\n", name, (global == TRUE ? GLOBAL_SYMBOL_DEF_SCL : LOCAL_SYMBOL_DEF_SCL));
+ } else {
+ if (!asm_writer_in_data_section (acfg))
+ fprintf (acfg->fp, "\t.data\n");
+ }
+
+ return;
+}
+
+#else
+