Mapfile option
The ELF linker,
ld(CP),
automatically and intelligently
maps input sections from object files (.o files)
to output segments in executable files (a.out files).
The mapfile option to the ld command
allows you to change the default mapping provided by the
ELF linker.
In particular, the mapfile option allows you to:
-
Declare segments and specify values for segment attributes
such as segment type, permissions,
addresses, length, and alignment.
-
Control mapping of input sections to segments by specifying the attribute values
necessary in a section to map to a specific segment
(the attributes are section name, section
type, and permissions)
and by specifying which object file(s) the input sections should be taken
from, if necessary.
-
Declare a global-absolute symbol that is assigned
a value equal to the size of a
specified segment (by the linker)
and that can be referenced from object files.
NOTE:
The major purpose of the mapfile option is to allow users of ifiles
(an option previously available to ld
that used link editor command language directives)
to convert to mapfiles.
All other facilities previously available for ifiles,
other than those mentioned above, are not available with the mapfile
option.
CAUTION:
When using the mapfile option,
be aware that you can easily create
a.out files that do not execute.
Therefore, the use of the mapfile option is strongly discouraged.
ld can produce a correct a.out
without the use of the mapfile option.
The mapfile option is intended for system programming use,
not application programming use.
This chapter describes the structure and syntax of a mapfile and the
use of the -M option to the ld command.
Next topic:
Using the mapfile option
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003