324_Book

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: e application calls the exit function. The exit function runs the functions registered by atexit, and then returns control to the operating system by calling exit). Next, the startup code calls the application’s main routine, which begins executing our C code. After the application returns, the startup code calls the exit routine, which returns control to the operating system. 7.9. LOADING EXECUTABLE OBJECT FILES 373 0xc0000000 kernel virtual memory user stack (created at runtime) memory invisible to user code %esp (stack pointer) 0x40000000 memory mapped region for shared libraries brk run-time heap (created at runtime by malloc) read/write segment (.data, .bss) read-only segment (.init, .text, .rodata) unused loaded from the executable file 0x08048000 0 Figure 7.13: Linux run-time memory image 1 2 3 4 5 6 7 0x080480c0 <_start>: /* entry point in .text */ call __libc_init_first /* startup code in .text */ call _init /* startup code in .init */ call atexit /* startup code in .text */ call main /* application main routine */ ca...
View Full Document

This note was uploaded on 09/02/2010 for the course ELECTRICAL 360 taught by Professor Schultz during the Spring '10 term at BYU.

Ask a homework question - tutors are online