aboutsummaryrefslogtreecommitdiffhomepage
path: root/codegen.c
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2025-08-13 02:25:32 +0900
committernsfisis <nsfisis@gmail.com>2025-08-15 10:06:21 +0900
commita5ab4f4dfacd1938a64df4d07df346774f62c541 (patch)
tree2eca028cfb7afbca9bb3668e89685d6768174e92 /codegen.c
parentd38303ba5860cdfb3f2532a3cc1e787a8cccbafd (diff)
downloadducc-a5ab4f4dfacd1938a64df4d07df346774f62c541.tar.gz
ducc-a5ab4f4dfacd1938a64df4d07df346774f62c541.tar.zst
ducc-a5ab4f4dfacd1938a64df4d07df346774f62c541.zip
feat: output .note.GNU-stack section and remove "-z noexecstack" from ld flags
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);