aboutsummaryrefslogtreecommitdiffhomepage
path: root/codegen.c
diff options
context:
space:
mode:
Diffstat (limited to 'codegen.c')
-rw-r--r--codegen.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/codegen.c b/codegen.c
index 59cee04..92a8619 100644
--- a/codegen.c
+++ b/codegen.c
@@ -531,6 +531,10 @@ void codegen(Program* prog) {
printf(".intel_syntax noprefix\n\n");
+ // For GNU ld:
+ // https://sourceware.org/binutils/docs/ld/Options.html
+ printf(".section .note.GNU-stack,\"\",@progbits\n\n");
+
printf(".section .rodata\n\n");
for (int i = 0; prog->str_literals[i]; ++i) {
printf(".Lstr__%d:\n", i + 1);