1
0
Fork 0

Use CONFIG_RUNMEM_RO=1 on apple

This commit is contained in:
herman ten brugge 2024-03-03 06:41:27 +01:00
parent 42395a1912
commit 9675c1e245
1 changed files with 9 additions and 1 deletions

View File

@ -289,8 +289,16 @@ static void cleanup_sections(TCCState *s1)
/* 0 = .text rwx other rw */
/* 1 = .text rx .rdata r .data/.bss rw */
/* Some targets implement secutiry options that do not allow write in
executable code. These targets need CONFIG_RUNMEM_RO=1.
The disadvantage of this is that it requires a little bit more memory. */
#ifndef CONFIG_RUNMEM_RO
# define CONFIG_RUNMEM_RO 0
# ifdef __APPLE__
# define CONFIG_RUNMEM_RO 1
# else
# define CONFIG_RUNMEM_RO 0
# endif
#endif
/* relocate code. Return -1 on error, required size if ptr is NULL,