
Motorola DSP Object File Format (COFF)
Differences In DSP Object Format And Standard COFF
E-30
DSP ASSEMBLER REFERENCE MANUAL
For More Information On This Product,
Go to: www.freescale.com
MOTOROLA
The Motorola DSP version of COFF addresses these potential problems by
normalizing
the object file. Normalization occurs in a number of ways. All structure and union ele-
ments are converted to long values, and raw data is stored in 4-byte quantities indepen-
dent of the word size of the target processor. In some cases this wastes space in the
object file and in memory but it was considered worth the price for transportability among
supported hosts. Also it is not a completely portable solution by any means (e.g. for ma-
chines with larger than 4-byte word sizes).
The byte ordering issue was dealt with by establishing a baseline ordering, providing com-
pliance for foreign hosts with conversion code. This introduces overhead logic on ma-
chines that do not support the baseline word order but again it was seen as a reasonable
trade-off to insure transportability of object files among development environments. Note
that byte swapping logic only comes into play for fields that are not byte-atomic, such as
integer fields. Character arrays in structures, for example, should not have their bytes ex-
changed.
The byte ordering for Motorola DSP COFF is shown in Figure E-30. It adheres to what
sometimes is called the
big-endian
approach to byte and word ordering.
Figure E-30 Motorola DSP COFF Byte Ordering
E.4.3 Structure Size Fields
In some of the COFF data structures there is a size field which gives the size of a block
in the target processor environment. For example, there are several symbol table auxil-
iary entries that specify the size of a structure or union for debug purposes. In standard
COFF these sizes ordinarily are in bytes but in Motorola DSP COFF they are given in
words unless otherwise indicated. The use of word sizes for debug entities should be dis-
tinguished from file pointer offset values in the object file. File pointers are indeed byte
offsets within the object file that are used by utilities to process information in the object
file itself.
E.4.4 Relocation Information
In standard COFF the
r_symndx
field of any given relocation record points to an entry in
the symbol table corresponding to a symbol reference requiring modification. When the
standard COFF Linker performs symbol resolution, pairing symbol definitions with match-
ing references, it updates the relocation entry to point to the symbol definition and dis-
Addr n
Addr n+1
Addr n+2
Addr n+3
MSB
MSB - 1
LSB + 1
LSB
F
Freescale Semiconductor, Inc.
n
.