mirror of
https://github.com/frida/tinycc
synced 2024-11-28 10:33:07 +03:00
Win64/PE: Changed runtime function unwind info to be added after relocation, fixes SEH + long jmps
This commit is contained in:
parent
fc0188ffbc
commit
32c9b51401
9
tccrun.c
9
tccrun.c
@ -247,10 +247,6 @@ static int tcc_relocate_ex(TCCState *s1, void *ptr, addr_t ptr_diff)
|
|||||||
}
|
}
|
||||||
relocate_plt(s1);
|
relocate_plt(s1);
|
||||||
|
|
||||||
#ifdef _WIN64
|
|
||||||
*(void**)ptr = win64_add_function_table(s1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for(i = 1; i < s1->nb_sections; i++) {
|
for(i = 1; i < s1->nb_sections; i++) {
|
||||||
s = s1->sections[i];
|
s = s1->sections[i];
|
||||||
if (0 == (s->sh_flags & SHF_ALLOC))
|
if (0 == (s->sh_flags & SHF_ALLOC))
|
||||||
@ -267,6 +263,11 @@ static int tcc_relocate_ex(TCCState *s1, void *ptr, addr_t ptr_diff)
|
|||||||
if (s->sh_flags & SHF_EXECINSTR)
|
if (s->sh_flags & SHF_EXECINSTR)
|
||||||
set_pages_executable((char*)ptr + ptr_diff, length);
|
set_pages_executable((char*)ptr + ptr_diff, length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _WIN64
|
||||||
|
*(void**)mem = win64_add_function_table(s1);
|
||||||
|
#endif
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user