https://s3-us-west-2.amazonaws.com/secure.notion-static.com/879f0f76-08c7-4e48-9b16-c5caf3aa0ac9/Untitled.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/2bdc3980-31c8-4588-9f2f-b8a733657696/Untitled.png

.TEXT the text region, instruction segment, is fixed by program and contains the program code. (READ-ONLY).

.DATA contains initialized data and uninitalized data.

HEAP. after BSS, the program can request more space in memory. via Brk sbrk system calls. used by Malloc, realloc, free .

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/26f84043-8fe0-434f-b407-f0d2ce6c140d/Untitled.png

int b (){
	return 0;
}

int a (){
	b();
	return 0;
}
int main(){
	a();
	return 0;
}

main() stackframe will be pushed onto the Stack. once it it done, pointer is set to the top of the stack and a new main() stack frame is created.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/33dd5b85-850e-4d49-bd2d-e9bde5e00051/Untitled.png

void functest(int a, int b, int c) {
	int test1 = 55;
	int test2 = 56;
}
int main(int argc, char *argv[]){
	int x =11;
	int z =12;
	int y =13;
	functest(30, 31,32);
	return 0;
}

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/b24642f0-c9fc-4f2e-b1cc-d684456b8708/Untitled.png

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/e368904d-c93c-47cd-9849-a393bf99f937/Untitled.png