Browse Source

gas: use .balign instead of .align

.align N can either mean align to
the next multiple of N or align to
the next multiple of 1<<N.

Credit goes to Jorge Acereda Maciá
for reporting this issue.
Quentin Carbonneaux 6 years ago
parent
commit
c8ffe7262f
1 changed files with 3 additions and 3 deletions
  1. 3 3
      gas.c

+ 3 - 3
gas.c

@@ -8,7 +8,7 @@ gasemitdat(Dat *d, FILE *f)
 {
 {
 	static int align;
 	static int align;
 	static char *dtoa[] = {
 	static char *dtoa[] = {
-		[DAlign] = ".align",
+		[DAlign] = ".balign",
 		[DB] = "\t.byte",
 		[DB] = "\t.byte",
 		[DH] = "\t.short",
 		[DH] = "\t.short",
 		[DW] = "\t.int",
 		[DW] = "\t.int",
@@ -24,7 +24,7 @@ gasemitdat(Dat *d, FILE *f)
 		break;
 		break;
 	case DName:
 	case DName:
 		if (!align)
 		if (!align)
-			fprintf(f, ".align 8\n");
+			fprintf(f, ".balign 8\n");
 		if (d->export)
 		if (d->export)
 			fprintf(f, ".globl %s%s\n", gassym, d->u.str);
 			fprintf(f, ".globl %s%s\n", gassym, d->u.str);
 		fprintf(f, "%s%s:\n", gassym, d->u.str);
 		fprintf(f, "%s%s:\n", gassym, d->u.str);
@@ -98,7 +98,7 @@ gasemitfin(FILE *f)
 		for (b=stash, i=0; b; b=b->link, i++) {
 		for (b=stash, i=0; b; b=b->link, i++) {
 			if (b->size == sz) {
 			if (b->size == sz) {
 				fprintf(f,
 				fprintf(f,
-					".align %d\n"
+					".balign %d\n"
 					"%sfp%d:",
 					"%sfp%d:",
 					sz, gasloc, i
 					sz, gasloc, i
 				);
 				);