Motorola dsp assembler Reference Manual



Yüklə 4,8 Kb.
Pdf görüntüsü
səhifə79/91
tarix08.10.2017
ölçüsü4,8 Kb.
#3546
1   ...   75   76   77   78   79   80   81   82   ...   91

Motorola DSP Object File Format (COFF)
Differences In DSP Object Format And Standard COFF
E-30
DSP ASSEMBLER REFERENCE MANUAL
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


Motorola DSP Object File Format (COFF)
Object File Data Expression Format
MOTOROLA
DSP ASSEMBLER REFERENCE MANUAL
E-31
cards the reference symbol. When the relocation entries are processed, the resolved
symbol value is used to modify the raw data indicated by the relocation entry at r_vaddr.
In Motorola DSP COFF r_symndx is an offset into the string table which points to a relo-
cation expression. The Linker interprets this expression and updates the entire word at
r_vaddr with the result of the expression evaluation. The relocation type is always zero.
See section E.5,   Object File Data Expression Format for more information on relocation
expressions.
E.4.5   Block Data Sections
Generic COFF does not make allowance for a block data section. A block data section
results from use of the Assembler BSC directive, where a large block of memory is initial-
ized with a single value. Block data sections are handled in Motorola DSP COFF by mak-
ing special use of the section s_vaddr field and adding an informative flag.
In most cases the section virtual address is the same as the physical address.  However,
for block data sections in Motorola DSP object files the virtual address field holds the re-
peat count for the single raw data value associated with the section.  For example, if the
assembly language source file included a directive of the form BSC $400,$FFFF the
s_vaddr field would contain the value $400, the s_size field would be 1 (or 2 if in L mem-
ory), and the single raw data word associated with the section would be $FFFF.  In addi-
tion, the STYP_BLOCK flag is set in the section s_flags field.
E.4.6   Other Extensions
If the object file is relocatable there are extra structures which the Assembler and Linker
generate to support special constructs such as logical sections, buffers, and overlays. The
optional link file header contains information which the Linker requires; it is described in
section E.3.2. Every symbol table entry for a section in a relocatable file has an extra aux-
iliary entry described in section E.3.4.6.2.
One special DSP COFF structure not documented elsewhere is the comment symbol. A
comment symbol table entry is emitted either indirectly via the Assembler IDENT directive
or directly with the COBJ directive (see Chapter 6). A comment symbol table entry may
be identified by a symbol name of .cmt and a type and storage class of zero. The value
field of a comment symbol holds the offset into the string table of the comment text. The
section number for a comment symbol produced with the IDENT directive is always -1.
Comment symbols generated with the COBJ directive have the section number of the
section where the COBJ directive appears in the source file. Comment symbols have no
auxiliary entry.
E.5
  OBJECT FILE DATA EXPRESSION FORMAT
Object file data expressions are used in data relocation records to represent values to be
loaded into memory. An expression is a combination of symbols, constants, operators,


Yüklə 4,8 Kb.

Dostları ilə paylaş:
1   ...   75   76   77   78   79   80   81   82   ...   91




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©genderi.org 2024
rəhbərliyinə müraciət

    Ana səhifə