diff options
| -rw-r--r-- | lib/libtcc1.c | 11 | ||||
| -rw-r--r-- | tccrun.c | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/libtcc1.c b/lib/libtcc1.c index dacee28..bfe683b 100644 --- a/lib/libtcc1.c +++ b/lib/libtcc1.c @@ -689,3 +689,14 @@ void __va_end(struct __va_list_struct *ap) } #endif /* __x86_64__ */ + +/* Flushing for tccrun */ +#if defined(__x86_64__) || defined(__i386__) + +void __clear_cache(char *beginning, char *end) +{ +} + +#else +#warning __clear_cache not defined for this architecture, avoid using tcc -run +#endif @@ -225,6 +225,7 @@ static void set_pages_executable(void *ptr, unsigned long length) end = (addr_t)ptr + length; end = (end + PAGESIZE - 1) & ~(PAGESIZE - 1); mprotect((void *)start, end - start, PROT_READ | PROT_WRITE | PROT_EXEC); + __clear_cache(ptr, prog_main + length); #endif } |
