First, grab some files into your cs31/inclass/10/ sub directory by running update31:
update31 cd ~cs31/inclass/10/ ls Makefile README mylib.c mylib.h prog.cWe are going to use this example code to illustrate the different stages of compiling a C program to an executable binary:
After the linking phase there are still some undefined symbols
from shared object files (.so). These are bound during the loading
phase when the runtime linker runs.
To see shared object dependencies: ldd prog
Lets briefly look at the phases of computation using the example code. The README file has some directions for viewing the output from each phase and for comparing it to previous phase output.
Loading takes place when you run your program. The program is loaded into RAM and the process' address space is created and initialized. Runtime linking may additionally take place if the executable file was linked with .so versions of libraries.
If you are interested in learning more about linking and loading, they are covered in much more detail in Chapter 7. Also, in Compilers (CS75) linking is covered in more detail, and in OS (CS45) loading is covered in more detail. I also have some documentation about the C compilation cycle, linking and loading and about tools for examining the output from different stages in this process: C compilation cycle and tools