- 论坛徽章:
- 0
|
本帖最后由 hauto 于 2012-05-03 18:33 编辑
汇编了一把,发现 0xb75efca6 是执行时当前函数栈地址.
(gdb) disassemble
Dump of assembler code for function main:
0x080483b4 <main+0>: lea 0x4(%esp),%ecx
0x080483b8 <main+4>: and $0xfffffff0,%esp
0x080483bb <main+7>: pushl -0x4(%ecx)
0x080483be <main+10>: push %ebp
0x080483bf <main+11>: mov %esp,%ebp
0x080483c1 <main+13>: push %ecx
0x080483c2 <main+14>: sub $0x14,%esp
0x080483c5 <main+17>: mov 0x4(%ebp),%eax //这个就是__builtin_return_address(0)
0x080483c8 <main+20>: movl $0x80483b4,0x8(%esp)
0x080483d0 <main+28>: mov %eax,0x4(%esp)
0x080483d4 <main+32>: movl $0x80484c0,(%esp)
0x080483db <main+39>: call 0x80482f0 <printf@plt>
0x080483e0 <main+44>: mov $0x0,%eax
0x080483e5 <main+49>: add $0x14,%esp
0x080483e8 <main+52>: pop %ecx
0x080483e9 <main+53>: pop %ebp
0x080483ea <main+54>: lea -0x4(%ecx),%esp
0x080483ed <main+57>: ret
End of assembler dump.
|
|