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
This commit is contained in:
grischka
2016-10-19 19:21:27 +02:00
parent 02919cd275
commit bfd1c08d6c
6 changed files with 100 additions and 48 deletions

10
tcc.h
View File

@ -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
/********************************************************/