Przeglądaj źródła

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 lat temu
rodzic
commit
0437e97a1b
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      gas.c

+ 2 - 1
gas.c

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