From bfd1c08d6c579445fe75dd633fbd9b0757cea5d0 Mon Sep 17 00:00:00 2001 From: grischka Date: Wed, 19 Oct 2016 19:21:27 +0200 Subject: tccrun/win64: cleanup runtime function table - call RtlDeleteFunctionTable (important for multiple compilations) - the RUNTIME_FUNCTION* is now at the beginning of the runtime memory. Therefor when tcc_relocate is called with user memory, this should be done manually before it is free'd: RtlDeleteFunctionTable(*(void**)user_mem); [ free(user_mem); ] - x86_64-gen.c: expand char/short return values to int --- tcc.h | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'tcc.h') diff --git a/tcc.h b/tcc.h index 9681903..bd4fee4 100644 --- a/tcc.h +++ b/tcc.h @@ -735,12 +735,8 @@ struct TCCState { #ifdef TCC_IS_NATIVE const char *runtime_main; - /* for tcc_relocate */ - void *runtime_mem; -# ifdef HAVE_SELINUX - void *write_mem; - unsigned long mem_size; -# endif + void **runtime_mem; + int nb_runtime_mem; #endif /* used by main and tcc_parse_args only */ @@ -1532,13 +1528,13 @@ ST_FUNC void dlclose(void *p); ST_FUNC const char *dlerror(void); ST_FUNC void *dlsym(int flag, const char *symbol); #endif - #ifdef CONFIG_TCC_BACKTRACE ST_DATA int rt_num_callers; ST_DATA const char **rt_bound_error_msg; ST_DATA void *rt_prog_main; ST_FUNC void tcc_set_num_callers(int n); #endif +ST_FUNC void tcc_run_free(TCCState *s1); #endif /********************************************************/ -- cgit v1.3.1