diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-08-10 20:07:05 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-15 10:06:21 +0900 |
| commit | 1d2d432a112ca20abf2cd0d82254204f0018407f (patch) | |
| tree | baa4971d227acb52ec1e9d292c15095c1b916527 | |
| parent | 3e7147bb740afb5c78944d2ef721af9bf5ddbb95 (diff) | |
| download | ducc-1d2d432a112ca20abf2cd0d82254204f0018407f.tar.gz ducc-1d2d432a112ca20abf2cd0d82254204f0018407f.tar.zst ducc-1d2d432a112ca20abf2cd0d82254204f0018407f.zip | |
feat: put string literals on read-only section
| -rw-r--r-- | codegen.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -527,6 +527,7 @@ void codegen(Program* prog) { printf(".intel_syntax noprefix\n\n"); + printf(".section .rodata\n\n"); int i; for (i = 0; prog->str_literals[i]; ++i) { printf(".Lstr__%d:\n", i + 1); @@ -535,6 +536,7 @@ void codegen(Program* prog) { printf(".globl main\n\n"); + printf(".text\n\n"); for (i = 0; i < prog->funcs->node_len; ++i) { AstNode* func = prog->funcs->node_items + i; codegen_func(g, func); |
