History

Win64/PE: Changed runtime function unwind info to be added after relocation, fixes SEH + long jmps

janus.lt committed 9 years ago

Commit 32c9b511 parent fc0188f1 file · +5 −4Browse files

Unified · Split

tccrun.c+5−4
@@ -247,10 +247,6 @@ static int tcc_relocate_ex(TCCState *s1, void *ptr, addr_t ptr_diff) · 246 unmodified lines
247 }247 }
248 relocate_plt(s1);248 relocate_plt(s1);
249 249
250#ifdef _WIN64
251 *(void**)ptr = win64_add_function_table(s1);
252#endif
253
254 for(i = 1; i < s1->nb_sections; i++) {250 for(i = 1; i < s1->nb_sections; i++) {
255 s = s1->sections[i];251 s = s1->sections[i];
256 if (0 == (s->sh_flags & SHF_ALLOC))252 if (0 == (s->sh_flags & SHF_ALLOC))
@@ -267,6 +263,11 @@ static int tcc_relocate_ex(TCCState *s1, void *ptr, addr_t ptr_diff) · 10 unmodified lines
267 if (s->sh_flags & SHF_EXECINSTR)263 if (s->sh_flags & SHF_EXECINSTR)
268 set_pages_executable((char*)ptr + ptr_diff, length);264 set_pages_executable((char*)ptr + ptr_diff, length);
269 }265 }
266
267#ifdef _WIN64
268 *(void**)mem = win64_add_function_table(s1);
269#endif
270
270 return 0;271 return 0;
271}272}
272 273

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t