[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] libtcc run in process compiled with O2 coredump
From: |
grischka |
Subject: |
Re: [Tinycc-devel] libtcc run in process compiled with O2 coredump |
Date: |
Sat, 20 Oct 2012 22:01:05 +0200 |
User-agent: |
Thunderbird 2.0.0.24 (Windows/20100228) |
jee wrote:
I use libtcc to compile code like this:
libtcc code:
typedef int (*tw_type_CLog2Svr__Write_53)(unsigned int val_0, char
val_1, void* val_2, void* val_3);
tw_type_CLog2Svr__Write_53 g_tw_type_CLog2Svr__Write_53;
int tw_CLog2Svr__Write_53(unsigned int val_0, char val_1, void* val_2,
void* val_3){
......
int val=
g_tw_type_CLog2Svr__Write_53(val_0, val_1, val_2, val_3);
......
return val;
}
g_tw_type_CLog2Svr__Write_53 is not initialized.
this code's asm is like this:
0x00007ffff5645980: mov 0x5af(%rip),%r11 # 0x7ffff5645f36
0x00007ffff5645987: mov (%r11),%r11
0x00007ffff564598a: callq *%r11
when the code come to 0x00007ffff564598a, it's codedump with SIGSEGV.
the ASM CODE 0x5af is wrong!
How is it wrong?
Also, what OS, what TCC version?
--- grischka