From 0437e97a1bb126cfa1974dad7b5479fa4b407f46 Mon Sep 17 00:00:00 2001 From: Érico Nogueira Date: Sun, 11 Jul 2021 16:12:19 -0300 Subject: 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. --- gas.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gas.c') diff --git a/gas.c b/gas.c index d339f3e..6d89a89 100644 --- a/gas.c +++ b/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"); } -- cgit 1.4.1