|
|
|
@ -46,7 +46,23 @@ void func0()
|
|
|
|
|
* functions as a setjmp/longjmp replacement wherever they are available
|
|
|
|
|
* unless USE_LIBC_SETJMP is defined.
|
|
|
|
|
*/
|
|
|
|
|
// for glibc 2.4+, it's not possible to get and set the sp in jmp_buf
|
|
|
|
|
// for glibc 2.4+, it's not possible to get and set the sp in jmp_buf
|
|
|
|
|
/**
|
|
|
|
|
for example, the following is show the jmp_buf when setjmp:
|
|
|
|
|
(gdb) x /64xb env_func1[0].__jmpbuf
|
|
|
|
|
0x600ca0 <env_func1>: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
|
|
|
|
0x600ca8 <env_func1+8>: 0xf8 0xc1 0x71 0xe5 0xa8 0x88 0xb4 0x15
|
|
|
|
|
0x600cb0 <env_func1+16>: 0xa0 0x05 0x40 0x00 0x00 0x00 0x00 0x00
|
|
|
|
|
0x600cb8 <env_func1+24>: 0x90 0xe4 0xff 0xff 0xff 0x7f 0x00 0x00
|
|
|
|
|
0x600cc0 <env_func1+32>: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
|
|
|
|
0x600cc8 <env_func1+40>: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
|
|
|
|
|
0x600cd0 <env_func1+48>: 0xf8 0xc1 0x51 0xe5 0xa8 0x88 0xb4 0x15
|
|
|
|
|
0x600cd8 <env_func1+56>: 0xf8 0xc1 0xd9 0x2f 0xd7 0x77 0x4b 0xea
|
|
|
|
|
(gdb) p /x $sp
|
|
|
|
|
$4 = 0x7fffffffe380
|
|
|
|
|
we cannot finger the sp out.
|
|
|
|
|
where the glibc is 2.12.
|
|
|
|
|
*/
|
|
|
|
|
register long int rsp0 asm("rsp");
|
|
|
|
|
|
|
|
|
|
int ret = setjmp(env_func1);
|
|
|
|
|