Mapfile structure and syntax
You can enter three types of directives into a mapfile:
-
segment declarations
-
mapping directives
-
size-symbol declarations
Each directive can span more than one line and can have any amount of
white space (including new-lines)
as long as it is followed by a semicolon.
You can enter 0 (zero) or more directives in a mapfile.
(Entering 0 directives causes
ld
to ignore the mapfile and use its own defaults.)
Typically,
segment declarations are followed by mapping directives.
You would declare a segment and then define the criteria by which a section
becomes part of that segment.
If you enter a mapping directive or size-symbol declaration
without first declaring the segment
to which you are mapping
(except for built-in segments, explained later),
the segment is given default attributes as explained below.
This segment is then an ``implicitly declared segment.''
Size-symbol declarations
can appear anywhere in a mapfile.
The following subtopics describe each directive type.
For all syntax discussions, the following apply:
-
All entries in
constant width,
all colons, semicolons, equal signs,
and at
(@)
signs
are typed in literally.
-
All entries in italics are substitutables.
-
{ ... } means ``zero or more.''
-
{ ... }+ means ``one or more.''
-
[ ... ] means ``optional.''
-
section_names and segment_names follow the same rules as
C identifiers where a period (.)
is treated as a letter (for example, .bss is a valid name).
-
section_names, segment_names, file_names,
and symbol_names are case
sensitive; everything else is not case sensitive.
-
Spaces (or new-lines) may appear anywhere except before
a
number
or in the middle of a name or value.
-
Comments beginning with ``#'' and ending at a new-line
may appear anywhere that a space may appear.
Next topic:
Segment declarations
Previous topic:
Using the mapfile option
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 27 April 2004