diff options
author | Érico Nogueira <erico.erc@gmail.com> | 2021-07-11 16:12:19 -0300 |
---|---|---|
committer | Quentin Carbonneaux <quentin@c9x.me> | 2021-08-02 10:55:10 +0200 |
commit | 0437e97a1bb126cfa1974dad7b5479fa4b407f46 (patch) | |
tree | b5afb3e175585449e6c8eb5083a2a1dad676c096 /gas.c | |
parent | 3da3815a674c922c520e013b30eb96c7491a5e85 (diff) | |
download | roux-0437e97a1bb126cfa1974dad7b5479fa4b407f46.tar.gz |
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.
Diffstat (limited to 'gas.c')
-rw-r--r-- | gas.c | 3 |
1 files changed, 2 insertions, 1 deletions
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"); } |