summary refs log tree commit diff
path: root/gas.c
diff options
context:
space:
mode:
Diffstat (limited to 'gas.c')
-rw-r--r--gas.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gas.c b/gas.c
index e67043b..4ac42be 100644
--- a/gas.c
+++ b/gas.c
@@ -2,6 +2,23 @@
 
 
 char *gasloc, *gassym;
+static int gasasm;
+
+void
+gasinit(enum Asm asmmode)
+{
+	gasasm = asmmode;
+	switch (gasasm) {
+	case Gaself:
+		gasloc = ".L";
+		gassym = "";
+		break;
+	case Gasmacho:
+		gasloc = "L";
+		gassym = "_";
+		break;
+	}
+}
 
 void
 gasemitlnk(char *n, Lnk *l, char *s, FILE *f)
@@ -25,6 +42,15 @@ gasemitlnk(char *n, Lnk *l, char *s, FILE *f)
 }
 
 void
+gasemitfntail(char *fn, FILE *f)
+{
+	if (gasasm == Gaself) {
+		fprintf(f, ".type %s, @function\n", fn);
+		fprintf(f, ".size %s, .-%s\n", fn, fn);
+	}
+}
+
+void
 gasemitdat(Dat *d, FILE *f)
 {
 	static char *dtoa[] = {