From 1082a32431dcd8f58432a6ce610d35cf37c553ad Mon Sep 17 00:00:00 2001 From: nsfisis Date: Wed, 7 Jan 2026 22:01:05 +0900 Subject: fix: make string literals compatible with PIE --- src/codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/codegen.c') diff --git a/src/codegen.c b/src/codegen.c index 4387449..4e93e89 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -74,7 +74,7 @@ static void codegen_int_expr(CodeGen* g, AstNode* ast) { } static void codegen_str_expr(CodeGen* g, AstNode* ast) { - fprintf(g->out, " mov rax, OFFSET FLAG:.Lstr__%d\n", ast->node_idx); + fprintf(g->out, " lea rax, .Lstr__%d[rip]\n", ast->node_idx); fprintf(g->out, " push rax\n"); } -- cgit v1.2.3-70-g09d2