- 论坛徽章:
- 0
|
再linux情景分析中,作者举了一个例子
#include <stdio.h>
greeting()
{
printf("Hello, world!\n");
}
main()
{
greeting();
}
反汇编以后
08048368 <greeting>:
8048368: 55 push %ebp
8048369: 89 e5 mov %esp,%ebp
804836b: 83 ec 08 sub $0x8,%esp
804836e: 83 ec 0c sub $0xc,%esp
8048371: 68 84 84 04 08 push $0x8048484
8048376: e8 35 ff ff ff call 80482b0 <printf@plt>
804837b: 83 c4 10 add $0x10,%esp
804837e: c9 leave
804837f: c3 ret
08048380 <main>:
8048380: 55 push %ebp
8048381: 89 e5 mov %esp,%ebp
8048383: 83 ec 08 sub $0x8,%esp
8048386: 83 e4 f0 and $0xfffffff0,%esp
8048389: b8 00 00 00 00 mov $0x0,%eax
804838e: 83 c0 0f add $0xf,%eax
8048391: 83 c0 0f add $0xf,%eax
8048394: c1 e8 04 shr $0x4,%eax
8048397: c1 e0 04 shl $0x4,%eax
804839a: 29 c4 sub %eax,%esp
804839c: e8 c7 ff ff ff call 8048368 <greeting>
80483a1: c9 leave
80483a2: c3 ret
80483a3: 90 nop
树上说,再main()调用call的时候,要走一个完整的,段式转换,页是转化的过程,但我不明白为什么要进行段式映射,请朋友们解释一下 |
|