我是靠谱客的博主 糟糕河马,这篇文章主要介绍return 和 exit 的反汇编结果,现在分享给大家,希望可以做个参考。

(gdb)  disassemble /m main
Dump of assembler code for function main:
3       {
   0x0000000000400474 <+0>:     push   %rbp
   0x0000000000400475 <+1>:     mov    %rsp,%rbp


4       int a;
5       return 0;
   0x0000000000400478 <+4>:     nop


6
7
8       }
   0x0000000000400479 <+5>:     leaveq 
   0x000000000040047a <+6>:     retq   


End of assembler dump.

(gdb) q



使用return 的反汇编代码






(gdb) dissemble /m main
Undefined command: "dissemble".  Try "help".
(gdb)  disassemble /m main
Dump of assembler code for function main:
3       {
   0x00000000004004c4 <+0>:     push   %rbp
   0x00000000004004c5 <+1>:     mov    %rsp,%rbp
   0x00000000004004c8 <+4>:     sub    $0x10,%rsp


4       int a;
5       exit(0);
   0x00000000004004cc <+8>:     mov    $0x0,%edi
   0x00000000004004d1 <+13>:    callq  0x4003b8 <exit@plt>


End of assembler dump.



使用exit(0)的反汇编代码





最后

以上就是糟糕河马最近收集整理的关于return 和 exit 的反汇编结果的全部内容,更多相关return内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(69)

评论列表共有 0 条评论

立即
投稿
返回
顶部