summary refs log tree commit diff
path: root/amd64/emit.c
diff options
context:
space:
mode:
Diffstat (limited to 'amd64/emit.c')
-rw-r--r--amd64/emit.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/amd64/emit.c b/amd64/emit.c
index 4cb340d..b8e9e8e 100644
--- a/amd64/emit.c
+++ b/amd64/emit.c
@@ -548,18 +548,9 @@ amd64_emitfn(Fn *fn, FILE *f)
 	Ins *i, itmp;
 	int *r, c, o, n, lbl;
 	uint64_t fs;
-	char *p;
 
-	p = fn->name[0] == '"' ? "" : gassym;
-	fprintf(f, ".text\n");
-	if (fn->export)
-		fprintf(f, ".globl %s%s\n", p, fn->name);
-	fprintf(f,
-		"%s%s:\n"
-		"\tpushq %%rbp\n"
-		"\tmovq %%rsp, %%rbp\n",
-		p, fn->name
-	);
+	gasemitlnk(fn->name, &fn->lnk, ".text", f);
+	fputs("\tpushq %rbp\n\tmovq %rsp, %rbp\n", f);
 	fs = framesz(fn);
 	if (fs)
 		fprintf(f, "\tsubq $%"PRIu64", %%rsp\n", fs);