aboutsummaryrefslogtreecommitdiff
path: root/tccrun.c
diff options
context:
space:
mode:
authorgrischka <grischka>2017-12-12 17:57:20 +0100
committergrischka <grischka>2017-12-12 17:57:20 +0100
commitd348a9a51d32cece842b7885d27a411436d7887b (patch)
tree52a0593e253b75ba7fa8d29a487771c977cff4c1 /tccrun.c
parent1a4d4b76e803a32db1168e66ad8f8b26c29c8ea0 (diff)
downloadtinycc-d348a9a51d32cece842b7885d27a411436d7887b.tar.gz
tinycc-d348a9a51d32cece842b7885d27a411436d7887b.tar.bz2
final update for 0.9.27main
tccgen.c: - fix ldouble asm hack - fix a VLA problem on Win64 (also x86_64-gen.c) - patch_type(): make sure that no symbol ever changes from global to static tcc.c: - tcc -vv: print libtcc1.a path also on win32 tccpe.c, tcctools.c: - use unix LF mode to for .def output files (that is for creating reproducible output trees) Makefile: - suppress some warnings when makeinfo is missing - call 'which install' only on win32 tests/Makefile: - change PATH only on WINNT systems (i.e. not if cross-compiling on linux for win32) - asm-c-connect.test: slim output and do diff tccrun.c tccpe.c *-link.c: - integrate former 'pe_relocate_rva()' into normal relocation This also fixes linkage of the unwind data on WIN64 for -run (reported by Janus Lynggaard Thorborg) tccasm.c, tests/tcctest.c: - fix dot (sym_index of -1 crashed in put_elf_reloc) - massage .set a bit (see test) other: - #define SECTION_ABS removed - ST_DATA Section *strtab_section: removed - put_extern_sym2(): take int section number Conflicts: tccelf.c tccpe.c Conflicts: tccelf.c
Diffstat (limited to 'tccrun.c')
-rw-r--r--tccrun.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/tccrun.c b/tccrun.c
index 20d72ce..9360164 100644
--- a/tccrun.c
+++ b/tccrun.c
@@ -238,6 +238,10 @@ static int tcc_relocate_ex(TCCState *s1, void *ptr, addr_t ptr_diff)
if (0 == mem)
return offset + RUN_SECTION_ALIGNMENT;
+#ifdef TCC_TARGET_PE
+ s1->pe_imagebase = mem;
+#endif
+
/* relocate each section */
for(i = 1; i < s1->nb_sections; i++) {
s = s1->sections[i];
@@ -306,11 +310,11 @@ static void *win64_add_function_table(TCCState *s1)
RtlAddFunctionTable(
(RUNTIME_FUNCTION*)p,
s1->uw_pdata->data_offset / sizeof (RUNTIME_FUNCTION),
- text_section->sh_addr
+ s1->pe_imagebase
);
s1->uw_pdata = NULL;
}
- return p;;
+ return p;
}
static void win64_del_function_table(void *p)
@@ -439,7 +443,7 @@ no_stabs:
if (wanted_pc >= sym->st_value &&
wanted_pc < sym->st_value + sym->st_size) {
pstrcpy(last_func_name, sizeof(last_func_name),
- (char *) strtab_section->data + sym->st_name);
+ (char *) symtab_section->link->data + sym->st_name);
func_addr = sym->st_value;
goto found;
}