This preview shows page 1. Sign up to view the full content.
Unformatted text preview: run an executable object ﬁle p, we can type its name to the Unix shell’s command line:
unix> ./p Since p does not correspond to a built-in shell command, the shell assumes that p is an executable object ﬁle, which it runs for us by invoking some memory-resident operating system code known as the loader. Any Unix program can invoke the loader by calling the execve function, which we will describe in detail in Section 8.4.6. The loader copies the code and data in the executable object ﬁle from disk into memory, and then runs the program by jumping to its ﬁrst instruction, or entry point. This process of copying the program into memory and then running it is known as loading. Every Unix program has a run-time memory image similar to the one in Figure 7.13. On Linux systems, the code segment always starts at address 0x08048000. The data segment follows at the next 4-KB aligned address. The run-time heap follows on the ﬁrst 4-KB aligned address past the read/write segment and grows up via calls to the malloc library. (We will describe malloc and the heap in detail i...
View Full Document