- A syntax analyser and
code generator
program
Note:
- When a C programmer says that
he/she
has compiled a program,
he/she could mean
one of the following:
- If "program" is
used to mean
one of the C program files
that make up the
multi-file program, then
he/she has
only performed
the above step on
that C program file
- If "program" is
used to mean the entire project,
he/she has
compiled all source files
and perform the
linkage step (see the next step) on
all object files to produce
the
executable program
|
|
- A "linking loader" program
- A "linking loader" program
combines the
machine code stored in
multiple files to
produce an
executable program
- The main task performed by
the "linking loader" is to
resolve the
variable and function reference
from one program file to
another program file
E.g.:
- When a global variable x is
defined in program p1.c
and the
variable x is
used (accessed) in
another program p2.c,
the "linking loader" must
find the memory address used
by the variable x and
"link" this address to
the
instructions in program p2.c
that refers to variable x.
|
|
|