From 518279dc3ee5d6ceeccedeb7a0ef5694a0e12640 Mon Sep 17 00:00:00 2001 From: herman ten brugge Date: Fri, 9 Jan 2026 08:25:28 +0100 Subject: [PATCH] Another update for macos Sorry about last commit. I had no access to a macos machine for a for weeks. --- tccrun.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/tccrun.c b/tccrun.c index 81304d5e..eca569d3 100644 --- a/tccrun.c +++ b/tccrun.c @@ -323,7 +323,7 @@ static void cleanup_sections(TCCState *s1) #ifndef CONFIG_RUNMEM_RO # ifdef __APPLE__ -# define CONFIG_RUNMEM_RO 2 +# define CONFIG_RUNMEM_RO 1 # else # define CONFIG_RUNMEM_RO 0 # endif @@ -359,23 +359,13 @@ redo: if (copy == 3) return 0; -#if defined TCC_TARGET_MACHO - for (k = 0; k < 3; ++k) { /* 0:rx, 1:ro, 3:rw sections */ -#else for (k = 0; k < 4; ++k) { /* 0:rx, 1:ro, 2:ro debug , 3:rw sections */ -#endif n = 0; addr = 0; for(i = 1; i < s1->nb_sections; i++) { -#if defined TCC_TARGET_MACHO - static const char shf[] = { - SHF_ALLOC|SHF_EXECINSTR, SHF_ALLOC, SHF_ALLOC|SHF_WRITE - }; -#else static const char shf[] = { SHF_ALLOC|SHF_EXECINSTR, SHF_ALLOC, 0, SHF_ALLOC|SHF_WRITE }; if (k == 2 && s1->do_debug == 0) continue; -#endif s = s1->sections[i]; if (shf[k] != (s->sh_flags & (SHF_ALLOC|SHF_WRITE|SHF_EXECINSTR))) continue;