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 --- tccelf.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tccelf.c') diff --git a/tccelf.c b/tccelf.c index a8ae48a..9ed2484 100644 --- a/tccelf.c +++ b/tccelf.c @@ -1735,6 +1735,7 @@ static void put_dt(Section *dynamic, int dt, addr_t val) dyn->d_un.d_val = val; } +#ifndef TCC_TARGET_PE static void add_init_array_defines(TCCState *s1, const char *section_name) { Section *s; @@ -1762,6 +1763,7 @@ static void add_init_array_defines(TCCState *s1, const char *section_name) ELFW(ST_INFO)(STB_GLOBAL, STT_NOTYPE), 0, s->sh_num, sym_end); } +#endif static int tcc_add_support(TCCState *s1, const char *filename) { @@ -1842,10 +1844,12 @@ ST_FUNC void tcc_add_linker_symbols(TCCState *s1) bss_section->data_offset, 0, ELFW(ST_INFO)(STB_GLOBAL, STT_NOTYPE), 0, bss_section->sh_num, "_end"); +#ifndef TCC_TARGET_PE /* horrible new standard ldscript defines */ add_init_array_defines(s1, ".preinit_array"); add_init_array_defines(s1, ".init_array"); add_init_array_defines(s1, ".fini_array"); +#endif /* add start and stop symbols for sections whose name can be expressed in C */ -- cgit v1.3.1