简体   繁体   English

execve调用函数后,堆栈如何看待? 甚至还有寄信人地址吗?

[英]How does the stack look after execve calls a function? Is there even a return address?

I'm trying to understand how the stack behaves when you use system call execve to call a new function. 我试图了解使用系统调用execve调用新函数时堆栈的行为。

I understand there should be variables argc , argv and envp . 我知道应该有变量argcargvenvp The last two should be pointers to the vectors containing the arguments and the environment. 最后两个应该是指向包含参数和环境的向量的指针。 Those vectors are also in the stackframe. 这些向量也在堆栈帧中。

I'm trying to understand what else might be in the stackframe. 我试图了解堆栈框架中可能还有什么。 Specifically: Does it follow any know calling convention? 具体来说:是否遵循任何已知的调用约定? Is there a return address? 有寄信人地址吗? Does it store the old stackpointer, as a function would? 它是否按功能存储旧的堆栈指针?

According to the Linux man page : 根据Linux手册页

execve() does not return on success, and the text, data, bss, and stack of the calling process are overwritten by that of the program loaded. execve()不会成功返回,并且调用过程的文本,数据,bss和堆栈会被加载的程序覆盖。

So, no, there is no return address, stack frame, etc. 因此,不,没有返回地址,堆栈帧等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM