最后那里,“注意,如果声明一个函数的返回值类型是int,函数中每个分支控制流程必须写return语句指定返回值,如果缺了return则返回值不确定(想想这是为什么)”。请问宋老师这是为什么呢?我想不明白哦!
因为返回值是通过eax传的。
Mr. Song, May I ask you a question? Why can't I see calling exit() in or the similar thing int $0x80 in _start routine? All I see in _sart is: push $0x80483c4 call 80482c4 <__libc_start_main@plt> hlt nop nop Where is exit? I'm confused! Thanks in advance!
That must be in the libc routine __libc_start_main. I think I have given enough hint for you to come up with this inference.
First of all, thanks to you for your patience. I find U exit@@GLIBC_2.0 symbol in executable file if I use C. How can I find _exit() symbol if I use assemble? I have another question: how do you know which obj file a function lies in? such as exit() is in libc, and how do you know where _exit() is in?
如果您有建设性意见,哪怕只是纠正一个错别字,也请不吝赐教,您留下的姓名和email将会出现在本书前言的致谢中。再次感谢您的宝贵意见!