#include
void fun(void) { printf("fun"); }
int main(int argc, char *argv[]){ fun(); return 0;} $ gcc -o test_ffp test.c $ gcc -fomit-frame-pointer -o test_ffp test.c
-rwxr-xr-x 1 Admin 40968 Jan 23 21:14 test.exe -rwxr-xr-x 1 Admin 40968 Jan 23 21:22 test_ffp.exe
$ gdb -q test.exe $ gdb -q test_ffp.exe
(gdb) disass main (gdb) disass main
Dump of assembler code for \
--ction main: Dump of assembler code for \
--ction main:
0x00401574 : push %ebp 0x00401573 : push %ebp
0x00401575 : mov %esp,%ebp 0x00401574 : mov %esp,%ebp
0x00401577 : and $0xfffffff0,%esp 0x00401576 : and $0xfffffff0,%esp
0x0040157a : call 0x401fb0 0x00401579 : call 0x401fb0
0x0040157f : call 0x401560 0x0040157e : call 0x401560
0x00401584 : mov $0x0,%eax 0x00401583 : mov $0x0,%eax
0x00401589 : leave 0x00401588 : leave
0x0040158a : ret 0x00401589 : ret
0x0040158b : nop 0x0040158a : nop
0x0040158c : xchg %ax,%ax 0x0040158b : nop
0x0040158e : xchg %ax,%ax 0x0040158c : xchg %ax,%ax
End of assembler dump. End of assembler dump. (gdb) disass fun (gdb) disass fun
Dump of assembler code for \
--ction fun: Dump of assembler code for \
--ction fun:
0x00401560 : push %ebp 0x00401560 : sub $0x1c,%esp
0x00401561 : mov %esp,%ebp 0x00401563 : movl $0x404024,(%esp)
0x00401563 : sub $0x18,%esp 0x0040156a : call 0x402738
0x00401566 : movl $0x404024,(%esp) 0x0040156f : add $0x1c,%esp
0x0040156d : call 0x402738 0x00401572 : ret
0x00401572 : leave End of assembler dump.
0x00401573 : ret (gdb)
End of assembler dump.
(gdb)

文件大小是一样,结果fun函数的汇编代码中push %ebp; leave; 没有啦.

-fomit-frame-pointer 编译选项在gcc 4.8.2版本中的汇编代码研究的更多相关文章

  1. 栈帧示意图:stack pointer、frame pointer

    更多参考:http://www.embeddedrelated.com/usenet/embedded/show/31646-1.php 一: The calling convention descr ...

  2. frame pointer及其用途

    1 什么是frame pointer frame pointer指向本函数栈帧顶,通过它可以找到本函数在进程栈中的位置.有专门的寄存器保存该值. 2 frame pointer有什么用 主要是back ...

  3. GCC 7.3.0版本编译http-parser-2.1问题

    http-paser是一个用c编写的http消息解析器,地址:https://github.com/nodejs/http-parser,目前版本2.9 今天用gcc 7.3.0编译其2.1版本时,编 ...

  4. GCC 嵌入汇编代码

    The format of basic inline assembly is very much straight forward. Its basic form is 基本汇编嵌入格式如下: asm ...

  5. GCC生成的汇编代码

    假设我们写了一个C代码文件 code.c包含下面代码: int accum = 0; int sum(int x, int y){ int t = x + y; accum += t; return ...

  6. paip.提升用户体验-----c++ gcc 命令在notepad++扩展中的配置..

    paip.提升用户体验-----c++ gcc 命令在notepad++扩展中的配置.. 作者Attilax ,  EMAIL:1466519819@qq.com  来源:attilax的专栏 地址: ...

  7. 测试一下robotgo自动化操作,顺便解决了原来的mingw版本中只有gcc,没有g++的问题

    参考:https://gitee.com/veni0/robotgo#examples  但是编译不成功 找到这个:https://gitee.com/veni0/robotgo#examples ( ...

  8. 排查GCC 4.4.X版本优化switch-enum的BUG

    起因 一次偶然碰到一个诡异的bug,现象是同一份C++代码使用GCC4.4.x版本在开启优化前和优化后的结果不一样,优化后的代码逻辑不正确. 示例代码如下: //main.cpp #include & ...

  9. gcc编译c中有与lua交互的代码

    编译C程序中有与Lua有关的程序(编译环境是Linux系统,lua解释器是luajit)gcc -o test30 test30.cpp -I/usr/local/include/luajit-2.0 ...

随机推荐

  1. 35.Android之带删除按钮EditText学习

    今天实现Android里自定义带删除功能的EditText,效果如下: 当输入内容时,EditText变为带有一个删除功能按钮的编辑框,如图: 实现代码很简单,直接上代码, 布局文件xml: < ...

  2. 【bzoj1486】 HNOI2009—最小圈

    http://www.lydsy.com/JudgeOnline/problem.php?id=1486 (题目链接) 题意 给出一张有向图,规定一个数值u表示图中一个环的权值/环中节点个数.求最小的 ...

  3. NOI2002 洛谷 P1196 银河英雄传说

    神奇的并查集问题 题目描述 公元五八○一年,地球居民迁移至金牛座α第二行星,在那里发表银河联邦 创立宣言,同年改元为宇宙历元年,并开始向银河系深处拓展. 宇宙历七九九年,银河系的两大军事集团在巴米利恩 ...

  4. JAVA中的数组是对象吗?

    public class Main{ public static void main(String[] args) { int a[]={1,9}; //Object obj=new int[10]; ...

  5. 代码重构-3 用Tuple代替 out与ref

    返回单一值是良好的编程习惯 原代码: public LotteryViewModel ValidateLottery(LotteryBaseData baseData, int authTime, o ...

  6. 常用webshell提权方法总结

    pcAnywhere提权:1.利用pcAnywhere提权,前提条件是pcAnywhere默认安装到默认路径,以及它的目录安全权限有users权限,如果管理员删除了users和power users用 ...

  7. AndroidStudio-引用jar包及so文件

    一.引用jar文件    1.将jar文件复制.粘贴到app的libs目录中:    2.右键点击jar文件,并点击弹出菜单中的"Add As Library",将jar文件作为类 ...

  8. Linux中表示“时间”的结构体和相关函数

    转载于:http://blog.chinaunix.net/uid-25909722-id-2827364.html      Linux中表示“时间”的结构体和相关函数 2011-09-13 17: ...

  9. 下面将详细说明useradd与usermod 的参数及用法!

    下面将详细说明useradd与usermod 的参数及用法! 说到这里要另外两句,关于linux下口令相关的文件存放位置说明/usr/bin/passwd 包含 passwd 命令. /etc/pas ...

  10. linux下忘记密码怎么办,如何重置密码

    文章转自:http://www.2cto.com/os/201104/86881.html 以下是网上的方法,我用的是第一种方法,经测试有效. 方法一:# /etc/init.d/mysql stop ...