3.PDF

(61 KB) Pobierz
Chapter 3
LINKER DIRECTIVES
3.1
MEMORY CONTROL FILE
A memory control file is simply a text file containing Linker directives. It optionally contains
module identification, a global starting load address for linking purposes, and ordering,
sizing, or placement information for any named sections. Section addresses may be for
any memory space and any logical location counter. The memory control file also can
specify physical memory mappings (internal, external) associated with any memory space
or counter. In addition, global unresolved symbols may be assigned values in the memory
control file.
3.2
LINKER DIRECTIVE DESCRIPTIONS
Linker directives are commands which control the operation of the Linker with respect to
section relocation, buffer alignment, symbol definition, and map file format. Linker direc-
tives are listed below:
BALIGN
BASE
IDENT
INCLUDE
MAP
MEMORY
REGION
RESERVE
SBALIGN
SECSIZE
SECTION
SET
SIZSYM
START
SYMBOL
Several of the directives use the notation
mem
or
memx
to indicate the contents of a field.
The definitions of
mem
and
memx
are as follows:
mem
memx
attr
scm
sme
spc
ctr
map
exp
=
=
=
=
=
=
=
=
=
<attr>:<exp>
<attr>:<exp>..<exp>
<scm>
|
<sme>
<spc>[<ctr>][<map>]
<spc>[<map>][(exp)]
X
|
Y
|
L
L
|
H
I
|
E
|
R
expression
|
|
P
A
|
B
MOTOROLA
DSP LINKER/LIBRARIAN REFERENCE MANUAL
3-1
Linker Directives
Linker Directive Descriptions
The
spc
field indicates one of the DSP memory spaces (X, Y, L, P). The
ctr
field specifies
either
Low
or
High
location counters; if none is given the default counter is used. Alterna-
tively, an expression in parentheses may be provided to indicate an arbitrary counter des-
ignation. The
map
field indicates
Internal
memory,
External
memory,
ROM,
port
A,
or port
B;
this field may be omitted, in which case no explicit mapping is done.
3-2
DSP LINKER/LIBRARIAN REFERENCE MANUAL
MOTOROLA
Linker Directives
Linker Directive Descriptions
BALIGN
Auto-align Circular Buffers
BALIGN
<mem>[,...,<mem>]
The
BALIGN
directive auto-aligns circular buffers within a particular region. All relocat-
able buffers found in any section within the region are relocated independently for optimal
placement in memory. Code and data around the buffer is made contiguous in order to fill
in previously occupied space. The <mem> argument indicates where in memory the align-
ment should begin.
Example:
BALIGN
XE:$200,YE:$200
; Realign X and Y external buffers
MOTOROLA
DSP LINKER/LIBRARIAN REFERENCE MANUAL
3-3
Linker Directives
Linker Directive Descriptions
BASE
Set Region Base Address
BASE
<mem>[,...,<mem>]
The
BASE
directive indicates where to begin the location counter for the given memory
region. This will be the base link address for all specified memory areas and all linked
code and data within the region except for sections relocated absolutely via a memory file
SECTION
directive. Code and data not explicitly relocated will originate from this ad-
dress. The
BASE
directive is analogous to the Linker
-O
command line option.
Example:
BASE
XE:$200,YE:$200,PI:$200 ; Set memory base addresses
3-4
DSP LINKER/LIBRARIAN REFERENCE MANUAL
MOTOROLA
Linker Directives
Linker Directive Descriptions
IDENT
Object Module Identification
IDENT
<module name> <version> <revision> [;<comment>]
The
IDENT
directive functions similarly to the assembler
IDENT
directive by identifying
the name, version number, and revision number of the absolute or incrementally linked
output module. The information is sent to the resulting output file. The <module name>
adheres to the rules for assembly language labels, so that it must begin with an alphabetic
character and consist only of alphanumeric characters or the underscore up to a length of
255. The version number and revision number must be absolute expressions. If a com-
ment follows the version and revision numbers it will be copied into the output file as well.
Example:
IDENT
MYMODULE
1
2
; MYMODULE, version 1, revision 2
MOTOROLA
DSP LINKER/LIBRARIAN REFERENCE MANUAL
3-5
Zgłoś jeśli naruszono regulamin