-
For example to load the math library with your program
the -lm option must be included when you perform the
load operation
A small assembler program is also loaded with your
program, this program sets up the environment for
executing your C program, it sets the stack pointer, sets
up the values of argc and argv and transfers control to
your main() procedure
The output from ld is often called an a.out file, since
this is the default name of the file
This is the executable version of the program, which is
divided into 3 basic sections:
text - the machine language or instructions for the
program
initialized data - the global variables in the program that
have been given initial values. This region also includes all
constants, like the literal string "Brian", or the number 5.5
uninitialized data - the global variables that haven't been
assigned initial values
The a.out file also has a header that specifies how the
program is to be executed, see man a.out for a detailed
description of this
|
 |