This preview shows page 1. Sign up to view the full content.
Unformatted text preview: n Section 10.9). The segment starting at address 0x40000000 is reserved for shared libraries. The user stack always starts at address 0xbfffffff and grows down (towards lower memory addresses). The segment starting above the stack at address 0xc0000000 is reserved for the code and data in the memory-resident part of the operating system known as the kernel. When the loader runs, it creates the memory image shown in Figure 7.13. Guided by the segment header table in the executable, it copies chunks of the executable into the code and data segments. Next, the loader jumps to the program’s entry point, which is always the address of the start symbol. The startup code at the start address is deﬁned in the object ﬁle crt1.o and is the same for all C programs. Figure 7.14 shows the speciﬁc sequence of calls in the startup code. After calling initialization routines in from the .text and .init sections, the startup code calls the atexit routine, which appends a list of routines that should be called when th...
View Full Document
- Spring '10
- The American