#include "entity.h"
#include "irprog.h"
+#include "ia32_emitter.h"
#include "ia32_gen_decls.h"
/************************************************************************/
return res;
}
+static void ia32_dump_comm(struct obstack *obst, const char *name, int size, int align) {
+ switch (asm_flavour) {
+ case ASM_LINUX_GAS:
+ obstack_printf(obst, "\t.comm\t%s,%d,%d\n", name, size, align);
+ break;
+ case ASM_MINGW_GAS:
+ obstack_printf(obst, "\t.comm\t%s,%d\n", name, size);
+ break;
+ }
+}
+
/*
* output the alignment
*/
};
static void dump_object_size(struct obstack *obst, const char *name, int size) {
- obstack_printf(obst, "\t.type\t%s,@object\n", name);
- obstack_printf(obst, "\t.size\t%s,%d\n", name, size);
+ switch (asm_flavour) {
+ case ASM_LINUX_GAS:
+ obstack_printf(obst, "\t.type\t%s,@object\n", name);
+ obstack_printf(obst, "\t.size\t%s,%d\n", name, size);
+ break;
+ }
}
/*
if (align < 1)
align = 1;
- obstack_printf(comm_obstack, "\t.comm\t%s,%d,%d\n", ld_name, (get_type_size_bits(ty) + 7) >> 3, align);
+ ia32_dump_comm(comm_obstack, ld_name, (get_type_size_bits(ty) + 7) >> 3, align);
}
}
}
size = obstack_object_size(&data);
cp = obstack_finish(&data);
if (size > 0) {
- fprintf(out, "\t.data\n");
+ ia32_switch_section(out, SECTION_DATA);
fwrite(cp, 1, size, out);
}
size = obstack_object_size(&comm);
cp = obstack_finish(&comm);
if (size > 0) {
- fprintf(out, "\t.text\n");
+ ia32_switch_section(out, SECTION_COMMON);
fwrite(cp, 1, size, out);
}