Skip to content

Commit 518279d

Browse files
committed
Another update for macos
Sorry about last commit. I had no access to a macos machine for a for weeks.
1 parent 1401967 commit 518279d

1 file changed

Lines changed: 1 addition & 11 deletions

File tree

tccrun.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static void cleanup_sections(TCCState *s1)
323323

324324
#ifndef CONFIG_RUNMEM_RO
325325
# ifdef __APPLE__
326-
# define CONFIG_RUNMEM_RO 2
326+
# define CONFIG_RUNMEM_RO 1
327327
# else
328328
# define CONFIG_RUNMEM_RO 0
329329
# endif
@@ -359,23 +359,13 @@ static int tcc_relocate_ex(TCCState *s1, void *ptr, unsigned ptr_diff)
359359
if (copy == 3)
360360
return 0;
361361

362-
#if defined TCC_TARGET_MACHO
363-
for (k = 0; k < 3; ++k) { /* 0:rx, 1:ro, 3:rw sections */
364-
#else
365362
for (k = 0; k < 4; ++k) { /* 0:rx, 1:ro, 2:ro debug , 3:rw sections */
366-
#endif
367363
n = 0; addr = 0;
368364
for(i = 1; i < s1->nb_sections; i++) {
369-
#if defined TCC_TARGET_MACHO
370-
static const char shf[] = {
371-
SHF_ALLOC|SHF_EXECINSTR, SHF_ALLOC, SHF_ALLOC|SHF_WRITE
372-
};
373-
#else
374365
static const char shf[] = {
375366
SHF_ALLOC|SHF_EXECINSTR, SHF_ALLOC, 0, SHF_ALLOC|SHF_WRITE
376367
};
377368
if (k == 2 && s1->do_debug == 0) continue;
378-
#endif
379369
s = s1->sections[i];
380370
if (shf[k] != (s->sh_flags & (SHF_ALLOC|SHF_WRITE|SHF_EXECINSTR)))
381371
continue;

0 commit comments

Comments
 (0)