Prechádzať zdrojové kódy

gas: always emit GNU-stack note

In cases where stash was 0, gasemitfin exits immediately and the
GNU-stack note isn't added to the asm output. This would result in an
executable where GNU_STACK uses flags RWE instead of the desired RW.
Érico Nogueira 4 rokov pred
rodič
commit
0437e97a1b
1 zmenil súbory, kde vykonal 2 pridanie a 1 odobranie
  1. 2 1
      gas.c

+ 2 - 1
gas.c

@@ -98,6 +98,8 @@ gasemitfin(FILE *f)
 	int sz, i;
 	int sz, i;
 	double d;
 	double d;
 
 
+	fprintf(f, ".section .note.GNU-stack,\"\",@progbits\n");
+
 	if (!stash)
 	if (!stash)
 		return;
 		return;
 	fprintf(f, "/* floating point constants */\n.data\n");
 	fprintf(f, "/* floating point constants */\n.data\n");
@@ -126,5 +128,4 @@ gasemitfin(FILE *f)
 		stash = b->link;
 		stash = b->link;
 		free(b);
 		free(b);
 	}
 	}
-	fprintf(f, ".section .note.GNU-stack,\"\",@progbits\n");
 }
 }