+static void
+emit_section_change (FILE *fp, const char *section_name, int subsection_index)
+{
+#if defined(sparc)
+ /* For solaris as, GNU as should accept the same */
+ fprintf (fp, ".section \"%s\"\n", section_name);
+#elif defined(__ppc__) && defined(__MACH__)
+ /* This needs to be made more precise on mach. */
+ fprintf (fp, "%s\n", subsection_index == 0 ? ".text" : ".data");
+#else
+ fprintf (fp, "%s %d\n", section_name, subsection_index);
+#endif
+}
+
+static void
+emit_global (FILE *fp, const char *name)
+{
+#if defined(__ppc__) && defined(__MACH__)
+ // mach-o always uses a '_' prefix.
+ fprintf (fp, ".globl _%s\n", name);
+#else
+ fprintf (fp, ".globl %s\n", name);
+#endif
+}
+
+static void
+emit_label (FILE *fp, const char *name)
+{
+#if defined(__ppc__) && defined(__MACH__)
+ // mach-o always uses a '_' prefix.
+ fprintf (fp, "_%s:\n", name);
+#else
+ fprintf (fp, "%s:\n", name);
+#endif
+}
+