Stack frames of Linux processes and functions in processes
It mainly understands the differences and connections between the stack frames of Linux processes and the stack frames of functions.
It depicts the structure of a Linux Process. The stack to be followed in this article is shown in the process memory area where the stack is at the bottom of 0xc0000000.
The actual size allocated for each process in Linux is not discussed in detail.
The overall perception of the stack of Linux processes is so much, that is
1) The stack bottom is at 0xc0000000 (the stack bottom pointer is not required, and the function stack frame requires the stack bottom pointer)
2) stack growth direction and address decrease direction
3) stack top pointer esp
4) unknown size (not the focus of this article)
5) What is the content stored in it?
Another concept is the stack frame concept of the function mentioned above and its relationship with the Linux Process stack.
The function stack frame is in the stack structure in the process, allocated address space, and actual memory.
The overall understanding of function stack frames is as follows:
1) ebp is the stack bottom of the function stack frame.
2) esp is the top of the stack
3) The stack frames of all functions of a process are established when this function is called. After the caller is returned, the stack frames of the function to be called no longer exist.
4) The establishment and disappearance of stack frames of all functions is a dynamic process that changes with the execution of processes.
In the stack provided by the process, the functions in the process should solve the relationship between the caller and the called.
1) How do I access the called user from the caller?
2) how to return the caller from the called user?
3) How does the caller control the called user (passing the called function parameters )?
4) How is the value of the called reflected (Transfer of return values )?
And so on
This article permanently updates the link address: